Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Re: Re: opposite of format?

by dash2 (Hermit)
on Jun 28, 2003 at 10:42 UTC ( #269846=note: print w/replies, xml ) Need Help??


in reply to Re: Re: opposite of format?
in thread opposite of format?

The alternative to unpack is to use a regex (see perlre). Unpack and formats are both rather obscure bits of perl - you might find learning regexes more useful at this stage. In fact, it sounds as if you only need a very simple split on whitespace. For the bottom part of the screen, which is just pairs of fields and values, separated by whitespace, you could do

my %fields = split(/\s+/, $line);

for each line. For the earlier bits, if you know that whitespace will be in the right place, you could do:

my ($last_name, $first_name, undef, $home_phone, %fields) = split(/\s+ +/, $line);
A massive flamewar beneath your chosen depth has not been shown here

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://269846]
help
Chatterbox?
[atcroft]: .oO(Then again, you also have to be careful if you had it to the database, and be aware of any assumptions it makes (such as SQLite assuming Gregorian calendar and a day of exactly 86400 seconds)...)

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (3)
As of 2017-04-29 04:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (531 votes). Check out past polls.