I think the issue is as you mentioned exporting find from File::Find::Rule.
However File::Find I am not sure I will get that flexibility to search only
1 level depth.
On Thu, Jan 10, 2013 at 6:07 PM, David Precious wrote:
> On Thu, 10 Jan 2013 17:56:18 +0530
> punit jain wrote:
>
> > I need to
punit jain wrote:
Hi,
Hello,
I have a requirement where I have directory structure like : -
test --> test/user1/files/, test/user2/files/, test/user3/files/ etc.
under sub-directories with usernames I have file with name usersettings.
So the final structure as : -
test / user1 / usersett
On Thu, 10 Jan 2013 17:56:18 +0530
punit jain wrote:
> I need to get all the subdirectories of test and then read the file
> usersettings under that later on to do some processing. I wrote code
> below :-
> #!/usr/bin/perl
> use strict;
> use warnings;
> use File::Basename qw(basename dirname);
>
On Aug 17, 11:45 am, [EMAIL PROTECTED] (Paul Lalli) wrote:
> On Aug 16, 7:21 pm, [EMAIL PROTECTED] (Mr. Shawn H. Corey) wrote:
>
> > Paul Lalli wrote:
> > > So define the subroutine in the same scope as the array. Move the
> > > subroutine into the if-statement as well.
>
> > Huh?
>
> What part of
> "Chas" == Chas Owens <[EMAIL PROTECTED]> writes:
>> I get it now, I think. I'm not sure why you put "my $i = 5" in there,
>> since that's unrelated to the $i of the closure.
Chas> The" my $i = 5;" was to show that the two variables named $i were
Chas> indeed in different scopes. The expe
On 8/18/07, Randal L. Schwartz <[EMAIL PROTECTED]> wrote:
> > ""Chas" == "Chas Owens" <[EMAIL PROTECTED]> writes:
>
> "Chas> {
> "Chas> my $i;
> "Chas> sub iter { return $i++ }
> "Chas> }
>
> "Chas> my $i = 5;
> "Chas> print iter(), "\n";
> "Chas> print iter(), "\n";
> "Chas> pr
> ""Chas" == "Chas Owens" <[EMAIL PROTECTED]> writes:
"Chas> {
"Chas> my $i;
"Chas> sub iter { return $i++ }
"Chas> }
"Chas> my $i = 5;
"Chas> print iter(), "\n";
"Chas> print iter(), "\n";
"Chas> print iter(), "\n";
"Chas> print iter(), "\n";
I get it now, I think. I'm not
On 8/17/07, Chas Owens <[EMAIL PROTECTED]> wrote:
snip
> which still works in Perl 5.8.8, but probably shouldn't. I thought
> they were going to fix this after Perl 5.6.1, but apparently it is
> still around (or has reemerged). Maybe Perl 6 will finally kill it (I
> have to test it in Pugs now).
On 8/17/07, Chas Owens <[EMAIL PROTECTED]> wrote:
snip
> Do you mean "broken" as in it doesn't work, it shouldn't work, or it
> is a bad idea? While I think it shouldn't work and it is a bad idea,
> it does, much to my surprise when I tested it before posting*,
> demonstrably** work with Perl 5.8.
On 8/17/07, Chas Owens <[EMAIL PROTECTED]> wrote:
snip
> warnings pragma). I think it is a variant of the classic obscenity
snip
> my $var if 0;
snip
> still around (or has reemerged). Maybe Perl 6 will finally kill it (I
> have to test it in Pugs now).
snip
Pugs prints five zeros, so it
> ""Chas" == "Chas Owens" <[EMAIL PROTECTED]> writes:
"Chas> ** here is the example for reference sake.
"Chas> #!/usr/bin/perl
"Chas> use strict;
"Chas> use warnings;
"Chas> {
"Chas>my $i;
"Chas>sub iter { return $i++ }
"Chas> }
"Chas> my $i = 5;
"Chas> print iter(), "\n";
"
On 8/17/07, Paul Lalli <[EMAIL PROTECTED]> wrote:
snip
> > see attached.
>
> And this file was supposed to demonstrate, what, exactly?
snip
I believe he was trying to demonstrate the "right way" to build an
iterator*, as opposed to the example** I used to show that, in fact, a
subroutine can be gi
On Aug 17, 11:13 am, [EMAIL PROTECTED] (Mr. Shawn H. Corey) wrote:
> Paul Lalli wrote:
> > On Aug 16, 7:21 pm, [EMAIL PROTECTED] (Mr. Shawn H. Corey) wrote:
> >> Paul Lalli wrote:
> >>> So define the subroutine in the same scope as the array. Move the
> >>> subroutine into the if-statement as well
Paul Lalli wrote:
On Aug 16, 7:21 pm, [EMAIL PROTECTED] (Mr. Shawn H. Corey) wrote:
Paul Lalli wrote:
So define the subroutine in the same scope as the array. Move the
subroutine into the if-statement as well.
Huh?
What part of what I said did you not understand?
All of it.
Please spe
> ""Dan" == "Dan Sopher" <[EMAIL PROTECTED]> writes:
"Dan> Thanks for everyone's replies. It helped a lot. It ended up like this.
"Dan> My next question is the use of the array reference, @list. Is it bad
"Dan> form?
Your solution confuses me.
Why not just:
my @list;
find sub { push @list,
On Aug 16, 7:21 pm, [EMAIL PROTECTED] (Mr. Shawn H. Corey) wrote:
> Paul Lalli wrote:
> > So define the subroutine in the same scope as the array. Move the
> > subroutine into the if-statement as well.
>
> Huh?
What part of what I said did you not understand?
> Please speak Perl.
Please learn s
On Aug 16, 7:21 pm, [EMAIL PROTECTED] (Mr. Shawn H. Corey) wrote:
> Paul Lalli wrote:
> > So define the subroutine in the same scope as the array. Move the
> > subroutine into the if-statement as well.
>
> Huh?
What part of what I said did you not understand?
> Please speak Perl.
Please learn s
On 8/16/07, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote:
> Paul Lalli wrote:
> > So define the subroutine in the same scope as the array. Move the
> > subroutine into the if-statement as well.
>
> Huh?
>
> Please speak Perl.
>
> Subroutines are global. Unless they're anonymous. And even then, t
Thanks for everyone's replies. It helped a lot. It ended up like this.
My next question is the use of the array reference, @list. Is it bad
form?
#!/usr/bin/perl -w
use strict;
use File::Find;
if (1) {
my $dir = "/var/SAMPLES";
my @list;
find ( { wanted=>sub { &found(
Paul Lalli wrote:
So define the subroutine in the same scope as the array. Move the
subroutine into the if-statement as well.
Huh?
Please speak Perl.
Subroutines are global. Unless they're anonymous. And even then, they are.
It's just difficult to get a hold on them.
--
Just my 0.0
Dan Sopher wrote:
Hello. The following code example creates a list of regular files in a
directory. Using File::Find, I'm unable to localize an array to hold the
list of files. Is there a way to create the list with a localized array?
TIA.
#!/usr/bin/perl -w
## Create a list of regular files
On Aug 16, 6:45 pm, [EMAIL PROTECTED] (Dan Sopher) wrote:
> Hello. The following code example creates a list of regular files in a
> directory. Using File::Find, I'm unable to localize an array to hold the
> list of files. Is there a way to create the list with a localized array?
> TIA.
>
> #!/usr/
On 8/16/07, Dan Sopher <[EMAIL PROTECTED]> wrote:
>
>
> Hello. The following code example creates a list of regular files in a
> directory. Using File::Find, I'm unable to localize an array to hold the
> list of files. Is there a way to create the list with a localized array?
> TIA.
>
>
>
> #!/usr/
23 matches
Mail list logo