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

Re: Re: accessing/printing specific rows in a flat file DB

by Limbic~Region (Chancellor)
on Aug 01, 2003 at 16:25 UTC ( [id://280034]=note: print w/replies, xml ) Need Help??


in reply to Re: accessing/printing specific rows in a flat file DB
in thread accessing/printing specific rows in a flat file DB

yosefm,
One minor nit:
print qq~ $itemName, $nmPrice ~ if $productId =~ m"^B00";

You have to make the m explicit if you are going to change the default delimiters in a match.

Cheers - L~R

Update: Apparently I am wrong and my apologies. It seems that the only time you have to make the m explicit if you are also dropping the binding operator by working on the default $_ as in if /^foo/ can't be done as if |^foo| it needs to be done as if m|^foo|

Replies are listed 'Best First'.
Re: Re: Re: accessing/printing specific rows in a flat file DB
by projekt21 (Friar) on Aug 01, 2003 at 16:32 UTC

    That was what I thought when reading, too, but it seems to work.:

    > perl -e '$a="abcd"; print "yes\n" if $a =~ "^abc";' yes > perl -e '$a="abcd"; print "yes\n" if $a =~ "^yyy";' >

    Strange, anyone knows more about this?

    alex pleiner <alex@zeitform.de>
    zeitform Internet Dienste

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (7)
As of 2024-04-19 17:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found