Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^4: Beware of global! And bless the local!

by Fletch (Bishop)
on Dec 12, 2019 at 17:59 UTC ( [id://11110029]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Beware of global! And bless the local!
in thread Beware of global! And bless the local!

I have the following yasnippets defined in my emacs.

$ cat ~/.emacs.d/snippets/cperl-mode/slurp # -*- snippet -*- #key: slurp #group: slurp #name: Slurp file-handle # -- my $${1:variable} = do { local $/; <$${2:fh}>; };
$ cat ~/.emacs.d/snippets/cperl-mode/slurp.open # -*- snippet -*- #key: slurp #group: slurp #name: Open and slurp # -- my $${1:variable} = do {$> local $/;$> open( my $${2:fh}, q{<}, ${3:$WHAT} )$> or die qq{Can't open "$3": $!\n}; <$$2>;$> };$>

The cake is a lie.
The cake is a lie.
The cake is a lie.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11110029]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-04-25 08:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found