Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^4: To print the file in spool with the new format of input file also

by Laurent_R (Canon)
on Oct 15, 2015 at 08:47 UTC ( [id://1144947]=note: print w/replies, xml ) Need Help??


in reply to Re^3: To print the file in spool with the new format of input file also
in thread To print the file in spool with the new format of input file also

unless ($basename =~ /^(.{4}|.{10})_(.{10})_(.{8})_(.{6})_(.{10})_(.{8 +})\.(.{3})(\.gz)?$/) { # ...
If the base name does not match the pattern, then abort with either of the two messages, depending on the condition on the next code line. If it does match, do what's in the else instruction.

It is equivalent (and usually slightly clearer) to turn the instructions around:

# Validate Filename Structure if ($basename =~ /^(.{4}|.{10})_(.{10})_(.{8})_(.{6})_(.{10})_(.{8})\. +(.{3})(\.gz)?$/) { # # File Name Format Fits # ($issuercode, $outputname, $date, $time, $userid, $sequenceno, $fi +letype) = ($1, $2, $3, $4, $5, $6, $7); } else { if ((system @COPY, $filename, sprintf "%s%s%s%s", $UNHANDLED, $del +imiter, $basename, $dupe_extn) == 0) { abort __LINE__,"bad filename '$filename', moved to unhandled d +irectory"; } else { abort __LINE__,"failed to move unhandled file '$filename'!"; } }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (3)
As of 2024-04-25 14:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found