Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

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

by haukex (Archbishop)
on Oct 18, 2021 at 15:06 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-04-25 21:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found