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

Re: read/write delete duplicates/sort PROBLEM! - Use of uninitialized value in sprintf

by haukex (Bishop)
on Oct 18, 2021 at 15:06 UTC ( #11137685=note: print w/replies, xml ) Need Help??


in reply to read/write delete duplicates/sort PROBLEM! - Use of uninitialized value in sprintf

m/<x id=(\d*)([[:alpha:]]*)>/ does not match <tagid=...>. If I change the regex to m/<tagid=(\d*)([[:alpha:]]*)>/, it works.

You should only use most of the Variables related to regular expressions like $1 and $2 if the match was successful, in other words:

if ( $tag =~ m/<tagid=(\d*)([[:alpha:]]*)>/ ) { $tags{sprintf("%04d%6s",$1 || 999,$2)} = $tag; } else { warn "Failed to match: $tag" }
  • Comment on Re: read/write delete duplicates/sort PROBLEM! - Use of uninitialized value in sprintf
  • Select or Download Code

Replies are listed 'Best First'.
A reply falls below the community's threshold of quality. You may see it by logging in.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (1)
As of 2022-01-16 19:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (49 votes). Check out past polls.

    Notices?