Reading the code....#!/usr/bin/perl use strict; use warnings; use Path::Class; my $dir = dir('foo','bar'); # foo/bar # Iterate over the content of foo/bar while (my $file = $dir->next) { # See if it is a directory and skip next if $file->is_dir(); # Print out the file name and path print $file->stringify . "\n"; }
my $dir = dir ('test1');
# local scalar dir is assigned by dir ('test1')
the dir on the RHS, being possibly from Path::Class (CPAN)
while (This condition hold true)
# Simple While
my $file = $dir->next
$dir scalar de-references the function next ? HOW ?
HOW do i guess that next would indeed be written as next and not next(), etc
since there is NO reference/example for "next" in
Class.pm
Same goes for stringify, or is_dir()
Now in this case is_dir() seems again to be a function, but how come its called differently
In reply to Arrow Operator and questions related to Path::Class by kamal
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |