Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Simple Noob Question

by jwkrahn (Monsignor)
on Mar 04, 2011 at 05:38 UTC ( #891362=note: print w/replies, xml ) Need Help??


in reply to Simple Noob Question

! defined and $_ = ' ' for @$row;

Could also be written as:

not defined( $_ ) and $_ = ' ' for @$row;

Or more simply in modern versions of Perl:

$_ //= ' ' for @$row;

1) ! means "not" as in the not operator (see example above.)

2) You can also use it for filehandles '_' and subroutines '&_'.    It is just another valid character that can be used as variable names (see perlvar.)

3) $row contains a reference to an array and to dereference the array you put a '@' in front of $row.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://891362]
help
Chatterbox?
[Corion]: This is a toy clone of Jekyll, currently named MrHyde. But maybe I'll change that name to Jokel / Yokel, or some other play on the name , still mildly unfunny ;)

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (9)
As of 2018-05-22 11:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?