Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: Re: (tye)Re: Cheap idioms

by Anonymous Monk
on Oct 13, 2002 at 21:59 UTC ( #204944=note: print w/replies, xml ) Need Help??

in reply to Re: (tye)Re: Cheap idioms
in thread Cheap idioms

This won't work for me, although tye's version will.
#!/usr/bin/perl use strict; use warnings; moose(); sub moose { my $filename = ''; my $contents = do { local (*ARGV, $/) = [ $filename ]; <> }; print $contents; } sub loose { my $filename = ''; my $data= do { local( *ARGV, $/ ); @ARGV= $filename; <> }; print $data; } __END__ readline() on unopened filehandle ARGV at line 8. Use of uninitialized value in print at line 9.
it opens a script to exemplify ternary ops. Nothing special there. Using: This is perl, v5.6.1 built for MSWin32-x86-multi-thread.

Replies are listed 'Best First'.
Re: Re: Re: (tye)Re: Cheap idioms
by Juerd (Abbot) on Oct 14, 2002 at 05:54 UTC

    Oh, darn, it doesn't work in 5.6.x, only 5.8. Ah well, back to tye's version then...

    I didn't know I had 5.8 installed :)

    - Yes, I reinvent wheels.
    - Spam: Visit eurotraQ.

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2023-06-10 15:38 GMT
Find Nodes?
    Voting Booth?
    How often do you go to conferences?

    Results (39 votes). Check out past polls.