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

Re^5: Wildcard in a hash

by AnomalousMonk (Archbishop)
on Jul 27, 2017 at 06:38 UTC ( [id://1196137]=note: print w/replies, xml ) Need Help??


in reply to Re^4: Wildcard in a hash
in thread Grep asterisk sign in input file

I'm pretty sure that the Anonymous Monk has the deductive, inductive and abductive logical skills to make some shrewd guesses about the specifications for your program. However, he/she/it isn't interested in writing your program for you, but rather in encouraging you to develop the skills to do these things for yourself.

Some general comments on the OPed code:

  • $vline =~ s/^\S+//; #trim leading space     This trims all leading non-spaces:  \S (big-S) is the complement of the  \s (little-s) whitespace class.
  • if ($_ =~ $identifier{$pins1.}) { ... }     This does not compile.
    c:\@Work\Perl\monks>perl -wMstrict -le "my %identifier = qw(one uno two dos three tres); ;; my $pins1 = 'two'; $_ = 'xdosx'; print 'match' if $_ =~ $identifier{$pins1.}; " syntax error at -e line 1, near ".}" Execution of -e aborted due to compilation errors.
    It's important to post example code that can actually run, even though it doesn't behave quite the way you want. Please see Short, Self-Contained, Correct Example.


Give a man a fish:  <%-{-{-{-<

Log In?
Username:
Password:

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

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

    No recent polls found