Perl tips

From Chuckipedia
Revision as of 22:33, 14 January 2023 by Admin (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Undefine vars

You have several ways to undef a list of vars already. The most simple I know is
( $from, $to ) = (); 

[1]

Chop

Create path based on file name

use Path::Class;

my $destination_file  = file('tardir/dest1/dest2/test.txt');
$destination_file->dir->mkpath;

# ... do the copying here

References