Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Challenge from my Fridge

by robartes (Priest)
on Mar 10, 2003 at 16:50 UTC ( #241770=note: print w/replies, xml ) Need Help??


in reply to Challenge from my Fridge

Or, if you want it on a line by itself, override flock():
#!/usr/local/bin/perl -w use strict; use subs qw(flock); sub the : lvalue {my $v="A flock"}; sub flock () {'of sheep'}; chomp the flock;
It compiles. Not to anything useful, but it compiles. It even runs. A bit like a flock of sheep, actually ;)

CU
Robartes-

Replies are listed 'Best First'.
Re: Re: Challenge from my Fridge
by Rhose (Priest) on Mar 10, 2003 at 21:27 UTC
    Ok, so once again I find myself killing a few minutes working with someone else's code. *Smiles*

    I went ahead and overrode chomp to make it chomp the flock.

    #!/usr/bin/perl -w use strict; use subs qw(chomp flock); my @gFlock=(1..10); sub chomp { pop @gFlock; } sub the { 'My flock is: ',shift,"\n"; } sub flock { join(' ',@gFlock); } while (flock) { print the flock; chomp the flock; }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2019-12-16 08:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?