Re: Script neeed for creating home directories for each student!!

2008-08-19 Thread yitzle
On Tue, Aug 19, 2008 at 10:39 AM, Jyotishmaan Ray <[EMAIL PROTECTED]> wrote: > I would need it in a different server to create all the home directories. > > Kindly provide a different script for that. There are websites out there that allow you to hire someone to work on a project for you... --

Re: Script neeed for creating home directories for each student!!

2008-08-19 Thread Jyotishmaan Ray
I  would need it in a different server to create all the home directories. Kindly provide a different script for that.    --- On Tue, 8/19/08, Anirban Adhikary <[EMAIL PROTECTED]> wrote: From: Anirban Adhikary <[EMAIL PROTECTED]> Subject: Re: Script neeed for creating home dir

Re: Script neeed for creating home directories for each student!!

2008-08-19 Thread Anirban Adhikary
You can do one thing you just add the following lines at end of the while loop like this The lines in bold character are newly added And one more thing when u will creating the home directory of the users then u have the write ownership on /mnt/btech directory. Regards Anirban Adhikary. use str

Script neeed for creating home directories for each student!!

2008-08-19 Thread Jyotishmaan Ray
Thank you Anirban. Also do you any script for creating the home directories in a server machine for 424 students in the path :  /mnt/btech/uid, where uid = s08-1-5-097 for the same file read, as before. All the students must have all permissions to read, write and execute in their home dir

Re: going through array of hash, it only goes through limited amount of keys while doing for each command

2008-04-23 Thread Richard Lee
John W. Krahn wrote: Richard Lee wrote: something is wrong with this.. say %yahoo's key contains the variable , X I wanted to go through the @array which has array of hashes... to see if one of the value is equal to X and if it is, wanted to assign the key of the @array to $ex_var.. Tracin

Re: going through array of hash, it only goes through limited amount of keys while doing for each command

2008-04-23 Thread Richard Lee
John W. Krahn wrote: Richard Lee wrote: something is wrong with this.. say %yahoo's key contains the variable , X I wanted to go through the @array which has array of hashes... to see if one of the value is equal to X and if it is, wanted to assign the key of the @array to $ex_var.. Tracin

Re: going through array of hash, it only goes through limited amount of keys while doing for each command

2008-04-23 Thread Richard Lee
John W. Krahn wrote: Richard Lee wrote: something is wrong with this.. say %yahoo's key contains the variable , X I wanted to go through the @array which has array of hashes... to see if one of the value is equal to X and if it is, wanted to assign the key of the @array to $ex_var.. Tracin

Re: going through array of hash, it only goes through limited amount of keys while doing for each command

2008-04-23 Thread Richard Lee
John W. Krahn wrote: Richard Lee wrote: something is wrong with this.. say %yahoo's key contains the variable , X I wanted to go through the @array which has array of hashes... to see if one of the value is equal to X and if it is, wanted to assign the key of the @array to $ex_var.. Tracin

Re: going through array of hash, it only goes through limited amount of keys while doing for each command

2008-04-23 Thread John W. Krahn
Richard Lee wrote: something is wrong with this.. say %yahoo's key contains the variable , X I wanted to go through the @array which has array of hashes... to see if one of the value is equal to X and if it is, wanted to assign the key of the @array to $ex_var.. Tracing the program, it only

going through array of hash, it only goes through limited amount of keys while doing for each command

2008-04-23 Thread Richard Lee
something is wrong with this.. say %yahoo's key contains the variable , X I wanted to go through the @array which has array of hashes... to see if one of the value is equal to X and if it is, wanted to assign the key of the @array to $ex_var.. Tracing the program, it only goes through 6 line

Re: Print to new file for each results

2006-08-30 Thread Ken Foskey
ry often...) then you can simply reopen the file for each record. while( <> ) { my @lines = split(/[|]/); my $file; open( $file, '>>', "$lines[1].out" ) or die... print $file $_; close( $file ) or die...; } -- Ken Foskey FOSS developer -- To unsubscri

Re: Print to new file for each results

2006-08-29 Thread John W. Krahn
this and > create > a file for each result. > > So I would have a deptA.out file with deptA info then a deptB.out > file with dept b info and etc. > > This is not exactly doing what I need: > > [ snip ] > > How would I create a file for each hash then print t

Print to new file for each results

2006-08-29 Thread Ron McKeever
I am tring to use part of someones elses code that creates a data file which prints out like this: ip|result|deptA|data ip|result|deptB|data ip|result|deptC|data My goal instead of having all the data in one big file is to loop this and create a file for each result. So I would have a

Re: Print to new file for each results

2006-08-29 Thread Mumia W.
for each result. So I would have a deptA.out file with deptA info then a deptB.out file with dept b info and etc... [...] Although this is very different from your program, it should give you the general idea: use strict; use warnings; use File::Slurp; use File::Spec::Functions; my

Re: Intersection for each pair of arrays

2006-08-23 Thread Adriano Ferreira
On 8/23/06, Derek B. Smith <[EMAIL PROTECTED]> wrote: From the previous emails, I do not understand what parts of this code is doing and why is this practical? The part is $union{$e} = 1 and $isect{$e} = 1 . Also %count is never used. It seems like Andrej made some mistakes in his code. I thin

Re: Intersection for each pair of arrays

2006-08-23 Thread Derek B. Smith
fy this example > that I can > > calculate union and intersection for each pair of > "n" arrays. > > Use a pair of nested loops; the outer picks one item > from the n > arrays, the inner picks a second. Inside, call your > current code once > for each pai

Re: Intersection for each pair of arrays

2006-08-23 Thread Mumia W.
On 08/23/2006 09:58 AM, Andrej Kastrin wrote: Hi, below is simple solution for union and intersection for a pair of arrays (@a and @b). How to modify this example that I can calculate union and intersection for each pair of "n" arrays. You could turn your code into a function a

Re: Intersection for each pair of arrays

2006-08-23 Thread Tom Phoenix
On 8/23/06, Andrej Kastrin <[EMAIL PROTECTED]> wrote: below is simple solution for union and intersection for a pair of arrays (@a and @b). How to modify this example that I can calculate union and intersection for each pair of "n" arrays. Use a pair of nested loops; the oute

Intersection for each pair of arrays

2006-08-23 Thread Andrej Kastrin
Hi, below is simple solution for union and intersection for a pair of arrays (@a and @b). How to modify this example that I can calculate union and intersection for each pair of "n" arrays. Thanks in advance for any suggestion, Andrej ## use warnings; @a = (

Re: for each

2005-10-07 Thread Mark Sargent
Wijaya Edward wrote: Hi Mark, Edward, for a beginner, would you mind explaining what the >(1 .. $#arr) $#arr is the index of the last element in the array ok, so 1 .. $#arr is the same as 1 .. 2 where 2 is the index of b, yes..? and qw actually do in this code.? Cheers

RE: for each

2005-10-07 Thread Thomas Bätzler
Mark Sargent <[EMAIL PROTECTED]> asked: > >>$ perl -e ' > >>@arr = qw (a b c); > >> foreach(1 .. $#arr) > >>{ > >> print "$arr[$_]\n"; > >>}' > Edward, for a beginner, would you mind explaining what the (1 > .. $#arr) and qw actually do in this code.? Cheers I'm not Edward, but I'll give it a

Re: for each

2005-10-07 Thread Wijaya Edward
Hi Mark, > > > > Edward, for a beginner, would you mind explaining what the >(1 .. $#arr) $#arr is the index of the last element in the array > and qw actually do in this code.? Cheers with "qw" you are treating values inside as individual words automatically. Thus you don't need to put quo

Re: for each

2005-10-07 Thread Mark Sargent
$ perl -e ' @arr = qw (a b c); foreach(1 .. $#arr) { print "$arr[$_]\n"; }' prints: b c Is that what you want? -- Regards, Edward WIJAYA SINGAPORE Hi All, Edward, for a beginner, would you mind explaining what the (1 .. $#arr) and qw actually do in this code.? Cheers Mark Sarg

RE: for each

2005-10-07 Thread Thomas Bätzler
Hi, [EMAIL PROTECTED] <[EMAIL PROTECTED]> asked: > How do I get a for each-statement to start at element 1 > (second element) # probably bad for long lists foreach my $item ( @list[1..$#list] ){ ... } # quick but destroys @list foreach my $item ( splice @list,1 ){ ... } Of

Re: for each

2005-10-07 Thread gustav
Hi there! Yes, exactly. Thanx a lot! :-) /G > > > - Original Message - > From: [EMAIL PROTECTED] > Date: Friday, October 7, 2005 3:29 pm > Subject: for each > >> Hi there! >> > Hi! > >> How do I get a for each-statement to start at element

Re: for each

2005-10-07 Thread Wijaya Edward
- Original Message - From: [EMAIL PROTECTED] Date: Friday, October 7, 2005 3:29 pm Subject: for each > Hi there! > Hi! > How do I get a for each-statement to start at element 1 (second > element) $ perl -e ' @arr = qw (a b c); foreach(1 .. $#arr) { print "$

for each

2005-10-07 Thread gustav
Hi there! How do I get a for each-statement to start at element 1 (second element) /G -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

no. of bytes for each matching code pt in $1

2005-06-02 Thread Rajarshi Das
Hi, I run this on z/OS and perl-5.8.6. $a = 128; $b = 256; for ($i=$a;$i<=$b;$i++) { $str = join '', $str, pack 'U*', $i; } if ($str =~ /(\p{inlatin1supplement}+)/) { print "\$1 : $1\n"; } I get the following values : a) for $a = 128 $b = 256 $1 has 1 byte

Re: out vs my for efficiency Was: 'my' for each loop or no ?

2002-01-10 Thread Eric Beaudoin
Thanks for the info Curis. I don't think I saw any answers from the more internal aware gurus out there and like Curtis, I would certainly like to know more about this. TIA At 14:32 2002.01.08, Curtis Poe wrote: >--- Eric Beaudoin <[EMAIL PROTECTED]> wrote: >> I was wondering if someone could

Re: out vs my for efficiency Was: 'my' for each loop or no ?

2002-01-08 Thread Curtis Poe
--- Eric Beaudoin <[EMAIL PROTECTED]> wrote: > I was wondering if someone could explain why a variable define with a global scope >was slower > that one define within the local lexical scope when used in a loop? If I recall correctly, you should usually get better performance from lexically scop

out vs my for efficiency Was: 'my' for each loop or no ?

2002-01-08 Thread Eric Beaudoin
At 08:28 2002.01.08, Prahlad Vaidyanathan wrote: >Hi, > >Was wondering which of these 2 pieces of code is more efficient : > > >my $file ; >foreach $file (@tarred) { #do something ; } >foreach $file (@gzipped) { #do something else ; } > > >OR > > >foreach my $file (@tarred)

Re: 'my' for each loop or no ?

2002-01-08 Thread Andrea Holstein
Prahlad Vaidyanathan wrote: > > Was wondering which of these 2 pieces of code is more efficient : > > > my $file ; > foreach $file (@tarred) { #do something ; } > foreach $file (@gzipped) { #do something else ; } > > > OR > > > foreach my $file (@tarred) { #do someth

Re: 'my' for each loop or no ?

2002-01-08 Thread walter valenti
Hi, could be more efficient the first code, because you allocate, the memory space one single time. In the second code you allocate the memory space every time. Walter > Hi, > > Was wondering which of these 2 pieces of code is more efficient : > > > my $file ; > foreach $file (@ta

'my' for each loop or no ?

2002-01-08 Thread Prahlad Vaidyanathan
Hi, Was wondering which of these 2 pieces of code is more efficient : my $file ; foreach $file (@tarred) { #do something ; } foreach $file (@gzipped) { #do something else ; } OR foreach my $file (@tarred) { #do something ; } foreach my $file (@gzipped) { #do some