Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Re: (tye)Re: Cheap idioms

by Anonymous Monk
on Oct 13, 2002 at 21:59 UTC ( [id://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 = 'ter.pl'; my $contents = do { local (*ARGV, $/) = [ $filename ]; <> }; print $contents; } sub loose { my $filename = 'ter.pl'; my $data= do { local( *ARGV, $/ ); @ARGV= $filename; <> }; print $data; } __END__ readline() on unopened filehandle ARGV at foo.pl line 8. Use of uninitialized value in print at foo.pl 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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-04-23 13:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found