Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Embed empty value using qw()

by rchiav (Deacon)
on Sep 02, 2001 at 09:59 UTC ( #109707=note: print w/replies, xml ) Need Help??


in reply to Embed empty value using qw()

According to perlop qw() is "exactly" like doing a
split(' ', q/STRING/);
That doesn't leave much room for an empty value. But for another way, you could fill the array using a slice..
@array[0..4,6..9] = qw(0 1 2 3 4 6 7 8 9);
Still not pretty, but it's something..

Rich

Replies are listed 'Best First'.
Re: Re: Embed empty value using qw()
by BrentDax (Hermit) on Sep 03, 2001 at 09:52 UTC
    Actually, it's more like doing that in a BEGIN block--qw(a b c) becomes ('a', 'b', 'c') at compile time (at least in newer Perls).

    =cut
    --Brent Dax
    There is no sig.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2021-09-23 00:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?