hello
first of all: i am new to the list.,
i work in the field-research. To begin with: well i have the data in a bunch of
plain text files on the local disk. Well i need to collect some of the data
out of a site - here is an example. http://www.bamaclubgp.org/forum/sitemap.php
the problem
> "(Randal" == (Randal L Schwartz) <[EMAIL PROTECTED]> writes:
(Randal> my @items = @$arrayRef;
(Randal> while (@items) {
(Randal> if (ref $items[0]) {
(Randal> if (ref $items[0] eq "ARRAY") {
(Randal> unshift @items, @{shift @items}; # replace arrayref with
co
Rodrick Brown wrote:
> On Sun, Jun 8, 2008 at 10:37 AM, Gunnar Hjalmarsson <[EMAIL PROTECTED]>
> wrote:
>
>> Rodrick Brown wrote:
>>
>>> #!/usr/bin/perl -w
>>>
>> The -w switch is redundant, since you have "use warnings;".
>>
>> use strict;
>>> use warnings;
>>> use Data::Dumper;
>>> my $file = '
Rodrick Brown wrote:
On Sun, Jun 8, 2008 at 10:37 AM, Gunnar Hjalmarsson <[EMAIL PROTECTED]>
wrote:
push @{ $hash->{$homeDir} }, $user;
Yes please explain how exactly that line works? I know @{} dereferences an
array so it looks like your pushing each user into an anonymous array.
Yes, t
oldgeezer wrote:
> Hi all,
>
> Last week I discovered this perl.beginners group.
> Good stuff here, albeit many times hard to grasp
> the answers. But I'm learning.
>
> What I would like to understand is why looping
> 2 times through 5000 lines takes less time than
> looping 5000 times through 2
On Sun, Jun 8, 2008 at 10:37 AM, Gunnar Hjalmarsson <[EMAIL PROTECTED]>
wrote:
> Rodrick Brown wrote:
>
>>
>> #!/usr/bin/perl -w
>>
>
> The -w switch is redundant, since you have "use warnings;".
>
> use strict;
>> use warnings;
>> use Data::Dumper;
>> my $file = '/etc/passwd';
>> my $hash;
>> my
moroshko wrote:
>
> What is the most efficient way to get a list of all file names (a full
> path) in a certain directory ?
> This should work recursively and include only files (not directories).
The canonical method is to use File::Find as John has described.
Rob
--
To unsubscribe, e-mail: [
[EMAIL PROTECTED] wrote:
>
> I'm doing the following:
>
> open FILE, ' # Do something with FILE
> close FILE;
> system 'command file.dat'; # This fails
>
> The last line fails even though I closed FILE. However, if I break
> out the last line into a separate script that is run later, it runs
>
Rodrick Brown wrote:
#!/usr/bin/perl -w
The -w switch is redundant, since you have "use warnings;".
use strict;
use warnings;
use Data::Dumper;
my $file = '/etc/passwd';
my $hash;
my ($user, $homeDir);
my $count=0;
Why did you declare that variable?
open(my $fh, "<", $file) or die("Fatal
> "Aruna" == Aruna Goke <[EMAIL PROTECTED]> writes:
Aruna> for my $item (@$arrayRef){
Aruna> print $item unless ref($item) eq 'ARRAY';
Aruna> if(ref($item) eq 'ARRAY'){
Aruna>for my $item1(@$item){
Aruna>print $item1 unless ref($item1) eq 'ARRAY';
Aruna> {
Arun
I want each Hash element to point to an array or list of users that share
the same home dir instead of another hash.
ie.
$VAR1 = {
'/var/imap' => {
'_cyrus'
},
'/var/empty' => {
'_spotlight'
From: oldgeezer <[EMAIL PROTECTED]>
> What I would like to understand is why looping
> 2 times through 5000 lines takes less time than
> looping 5000 times through 2 lines.
>
> To show what I mean, I wrote a snippet that
> does nothing with the data and yet the first
> part is 5 times faster than
moroshko wrote:
Hello experts !
Hello,
What is the most efficient way to get a list of all file names (a full
path) in a certain directory ?
This should work recursively and include only files (not directories).
use File::Find;
my @all_file_names;
find sub {
return if -d;
push @al
oldgeezer wrote:
Hi all,
Hello,
Last week I discovered this perl.beginners group.
Good stuff here, albeit many times hard to grasp
the answers. But I'm learning.
If you have any questions just ask (the list.)
What I would like to understand is why looping
2 times through 5000 lines takes
"Rodrick Brown" schreef:
> my $arrayRef = [ 1, 2, 3, ['a', 'b', 'c', ["Hello"] ]];
>
> I have no problem returning single elements but how would one walk
> this list of elements with say a for loop?
Start writing it differently, maybe like:
my $data = [
1,
2,
3,
[ 'a',
moroshko schreef:
> What is the most efficient way to get a list of all file names (a full
> path) in a certain directory ?
> This should work recursively and include only files (not directories).
Consider IO::All.
--
Affijn, Ruud
"Gewoon is een tijger."
--
To unsubscribe, e-mail: [EMAIL PR
Hi all,
Last week I discovered this perl.beginners group.
Good stuff here, albeit many times hard to grasp
the answers. But I'm learning.
What I would like to understand is why looping
2 times through 5000 lines takes less time than
looping 5000 times through 2 lines.
To show what I mean, I wrot
On Sat, Jun 7, 2008 at 11:30 PM, moroshko <[EMAIL PROTECTED]> wrote:
> Hello experts !
>
> What is the most efficient way to get a list of all file names (a full
> path) in a certain directory ?
> This should work recursively and include only files (not directories).
Hi,
Just show a way.
The code
Hi,
I'm doing the following:
open FILE, 'http://learn.perl.org/
Hello John,
Am 2008-06-06 11:06:09, schrieb John W. Krahn:
> $ perl -le'printf "%o\n", 33279'
> 100777
>
>
> 33279 is the decimal representation of a number, and 0777 is the octal
> representation of a number. If a number has a leading zero it is
> usually displayed in octal representation.
>
Hello experts !
What is the most efficient way to get a list of all file names (a full
path) in a certain directory ?
This should work recursively and include only files (not directories).
Thanks in advance !
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
Rodrick Brown wrote:
I'm trying to fully understand references so I created a data structure to
stores the output of users on my system who share home dirs.
I use a HoH to represent this data set but its not working as expected.
Conceptually I can visualize how the data should look but I cant get
Rodrick Brown wrote:
I'm trying to fully understand references so I created a data structure to
stores the output of users on my system who share home dirs.
I use a HoH to represent this data set but its not working as expected.
Conceptually I can visualize how the data should look but I cant get
Rodrick Brown wrote:
I'm trying to fully understand references so I created a data structure to
stores the output of users on my system who share home dirs.
I use a HoH to represent this data set but its not working as expected.
Conceptually I can visualize how the data should look
Perhaps if y
I'm trying to fully understand references so I created a data structure to
stores the output of users on my system who share home dirs.
I use a HoH to represent this data set but its not working as expected.
Conceptually I can visualize how the data should look but I cant get the
output any assista
25 matches
Mail list logo