Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

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 = '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.


Comment on Re: Re: (tye)Re: Cheap idioms
Download Code
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
Node Status?
node history
Node Type: note [id://204944]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2014-08-30 20:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (293 votes), past polls