El Tuesday 19 August 2008 21:15:27 Dr.Ruud va escriure:
> Xavier Mas schreef:
> > Dr.Ruud:
> >> Xavier Mas:
> >>> m#(pattern)#;
> >>> $variable= $1.;
> >>
> >> That can be written as:
> >> ($variable) = /(pattern)/;
> >
> > Thank you for pointing that, Dr. Ruud but, what does mean
> > ($variable)
Hi Noah,
Would defining $templateConfiguration outside of the for loop be
sufficient for what you need?
i.e.,
my $templateConfiguation;
foreach my $templateConfigFilename (@templateConfigFilenames) {
$templateConfigFilename = "$TemplateDirectory/$templateConfigFilename";
(my $sortedTem
John W. Krahn wrote:
Noah wrote:
response inline below
John W. Krahn wrote:
Noah wrote:
I have a routine returning a perl reference and I am trying to
figure out how to properly use the hash tables in the main section
of my perl proggie.
--- from the main program
my $templateConfiguati
Hi all,
I'm trying to fork a process under modperl for a web server, but I've
realized that the problem / misunderstanding that I'm having is
unrelated to modperl...I get the same problem under Perl. What I want
to do is to fork a child process (non-perl program), but also time how
long it
Noah wrote:
Hi List,
Hello,
Is there a more optimal way to present this data structure without
becoming completely convoluted?
--- snip ---
for my $key (sort keys %usernames) {
my $found = 0;
for my $knownusername (@knownusernames) {
if ($knownusername eq $
Date sent: Tue, 19 Aug 2008 15:08:43 -0700
From: Noah <[EMAIL PROTECTED]>
To: Perl Beginners
Subject:searching arrays - more optimal code
> Hi List,
>
> Is there a more optimal way to present this data structure without
> becomi
On Aug 19, 2008, at 1:48 PM, Jyotishmaan Ray wrote:
Dear All,
I am a new bie in perl. I have to create the home directories of 424
students in a server machine.
The path of the home directory would be :-
/mnt/btech/formatted-rollno.
where formatted-rollno ="s08-1-5-097"
And the input
On Aug 19, 2008, at 1:43 PM, Paul Lalli wrote:
On Aug 19, 11:16 am, [EMAIL PROTECTED] (Perry Smith) wrote:
My friend is trying to do this:
#!/bin/perl
$a = 1;
$b = 2;
$c = 3;
@l = ( \$a, \$b, \$c );
# This is the line we need help with
# Is there a way to tell Perl that @l[0] is a referenc
Hi List,
Is there a more optimal way to present this data structure without
becoming completely convoluted?
--- snip ---
for my $key (sort keys %usernames) {
my $found = 0;
for my $knownusername (@knownusernames) {
if ($knownusername eq $key) {
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...
--
"Irfan J Sayed (isayed)" schreef:
> Please find the attached log.
I don't see the output of `perl -V` there. You did do `perl -v`.
> Please please suggest. Now it is asking to enter the CPAN site.
It looks like you are behind a firewall that doesn't allow ftp nor http
traffic.
Do you have an h
Noah wrote:
response inline below
John W. Krahn wrote:
Noah wrote:
I have a routine returning a perl reference and I am trying to figure
out how to properly use the hash tables in the main section of my
perl proggie.
--- from the main program
my $templateConfiguation =
&readConfigTemplat
John W. Krahn wrote:
Kashif Salman wrote:
How can I capture "Start" as well? putting brackets around it like so
doesn't work:
/^(Start)/ && <> =~ /^(\d+)\/(\d+)\/(\d+)/ && print "$1=> 20$4-$2-$3";
I know it seems pointless to capture start but it doesn't always say
"Start"
so I want to capt
response inline below
John W. Krahn wrote:
Noah wrote:
Hi there,
Hello,
I have a routine returning a perl reference and I am trying to figure
out how to properly use the hash tables in the main section of my perl
proggie.
--- from the main program
my $templateConfiguation =
&readConfig
Orson schreef:
> Dr.Ruud:
>> my $digit = q{\d};
>> my $wsp = q{\s};
>>
>> my $pt = qr{ $digit $wsp $digit }x;
>> print $pt;
>
> But once I get it in variable $pt, what syntax to use
> for the if (/$pt/) statemet?
That syntax is ok. Again: read the documentation of qr.
--
Affijn, Ruud
"Gewo
Xavier Mas schreef:
> Dr.Ruud:
>> Xavier Mas:
>>> m#(pattern)#;
>>> $variable= $1.;
>>
>> That can be written as:
>> ($variable) = /(pattern)/;
>
> Thank you for pointing that, Dr. Ruud but, what does mean
> ($variable)?.
/(pattern1).*?(pattern2)/ returns the matches in list context, and the
"Dr.Ruud" schreef:
> "ANJAN PURKAYASTHA":
>> $HOA{$key}= [qw(a,b,c,d)];
>
> which is equivalent to
>
> $HOA{ $key } = [ 'a', 'b', 'c', 'd' ];
Oops, as Ron wrote, your qw(a,b,c,d) was probably meant to be qw(a b c
d).
--
Affijn, Ruud
"Gewoon is een tijger."
--
To unsubscribe, e-mail: [EMAI
Jyotishmaan Ray <[EMAIL PROTECTED]> wrote:
>
> Dear All,
>
> I am a new bie in perl. I have to create the home directories of 424 students
> in a server machine.
>
> The path of the home directory would be :-
>
> /mnt/btech/formatted-rollno.
>
> where formatted-rollno ="s08-1-5-097"
>
Dear All,
I am a new bie in perl. I have to create the home directories of 424 students
in a server machine.
The path of the home directory would be :-
/mnt/btech/formatted-rollno.
where formatted-rollno ="s08-1-5-097"
And the input file contains all the rollnos of 424 students.
A sampl
On Aug 19, 11:16 am, [EMAIL PROTECTED] (Perry Smith) wrote:
> My friend is trying to do this:
>
> #!/bin/perl
>
> $a = 1;
> $b = 2;
> $c = 3;
>
> @l = ( \$a, \$b, \$c );
>
> # This is the line we need help with
> # Is there a way to tell Perl that @l[0] is a reference
> # and we want to assign what
Kashif Salman wrote:
How can I capture "Start" as well? putting brackets around it like so
doesn't work:
/^(Start)/ && <> =~ /^(\d+)\/(\d+)\/(\d+)/ && print "$1=> 20$4-$2-$3";
I know it seems pointless to capture start but it doesn't always say "Start"
so I want to capture it. for simplicity l
On Aug 19, 2008, at 12:12 PM, nikhil mehra wrote:
Hi,
Can we use egrep in perl program which would just open a file and
search a
literal string using egrep.
Cna some one help me with syntax.
Thanks,
--
Nikhil Mehra
"The only Constant in Life is CHANGE!"
"Whether it is mainframe, client
Take a look at the CPAN module Net::SSH.
Example
use strict;
use Net::SSH qw(ssh ssh_cmd);
my @dirlist = remote_cmds("ls'");
mimi
2008/8/19 Irfan J Sayed (isayed) <[EMAIL PROTECTED]>
> Hi All,
>
> Can somebody have the sample Perl script which will fire the "ls"
> command on remote linux ma
Hi,
Can we use egrep in perl program which would just open a file and search a
literal string using egrep.
Cna some one help me with syntax.
Thanks,
--
Nikhil Mehra
"The only Constant in Life is CHANGE!"
"Whether it is mainframe, client-server, distributed, grid or web services
computing — n
i'm using -threads option in my NetBSD machine and work fine.
I don't know how do it in Solaris.
Regards
On Mon, Aug 18, 2008 at 7:35 AM, Surendiran Subramanian
<[EMAIL PROTECTED]> wrote:
> Hi All,
>
> Can you please provide me the details for enabling the ithread for existing
> perl version
On Aug 18, 1:03 pm, [EMAIL PROTECTED] (Anjan Purkayastha)
wrote:
> hi,
> i'm struggling with a hash of arrays problem.
> suppose i create the following HOA:
> $HOA{$key}= [qw(a,b,c,d)];
I doubt that the results of that assignment is what you want/expect.
#!/usr/bin/perl
#use strict;
use warnings
On Aug 19, 3:27 am, [EMAIL PROTECTED] (Dr.Ruud) wrote:
> Orson schreef:
>
> > what I need is construct a reg ex pattern and store
> > in variable. I need to concatenate this from many other variables.
> > Then I must use this variable to do a match. Something like this:
> > while (<>)
> > {
> >
On Fri, Aug 15, 2008 at 9:03 AM, Chris Charley <[EMAIL PROTECTED]> wrote:
> On Wed, Aug 13, 2008 at 10:05 AM, John W. Krahn <[EMAIL PROTECTED]> wrote:
>>
>> Kashif Salman wrote:
>>>
>>> Greetings,
>>> Hello,
>>>
>>> I have a log file like so, and I am trying to get the date on the nex
From: "Anirban Adhikary" <[EMAIL PROTECTED]>
> my($a,$b);
Don't! Variables $a and $b are special. They are used in the
sort{block} and have a bit special scope and declaration rules. You'd
better not use them outside sort{}.
> my $uidNumber=2631;
> my $gidNumber=2631;
> open(FH,"/home/anadhikar
My friend is trying to do this:
#!/bin/perl
$a = 1;
$b = 2;
$c = 3;
@l = ( \$a, \$b, \$c );
# This is the line we need help with
# Is there a way to tell Perl that @l[0] is a reference
# and we want to assign what it refers to the number 4.
# i.e. ${$l[0]} = 4;
# but for the whole list in @l
(
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 directories for e
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
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
On Tue, 2008-08-19 at 16:50 +0530, SAP wrote:
> Hi Shawn,
> I want to dump a string to the remote sever with the
> current GMT date and time
> This is the string:
> $send_data = strftime (::DATA::123456789101112,"%d.%m.%Y,%H:%M:%
> S",13.0076367,77.5489267,0,933.4,AirTel,3
Hi All,
Can somebody have the sample Perl script which will fire the "ls"
command on remote linux machine and give the exit status whether it is
success or failure.
OR can somebody please guide me step by step how to achieve this
Please help.
Regards
Irf.
On Mon, 2008-08-18 at 21:55 -0700, Arun wrote:
> What is wrong with this string.
>
> $send_data = (print strftime "::DATA::123456789101112,%d.%m.%y,%H:%M:
> %S,13.0076367,77.5489267,0,933.4,AirTel,31,0", gmtime);
>
>
Nothing.
Why don't you tell us what you expect?
--
Just my 0.0002 mill
El Monday 18 August 2008 16:56:13 Merdinus va escriure:
> The command that's causing this error is:
>
> my @refs = split('[', $references);
> I also tried >>> my @refs = split("[", $references); <<< (doublle
> quotes instead)
> and got the same error.
> If I change it to
>
> my @ref
Hi,
Please find the attached log.
Please please suggest. Now it is asking to enter the CPAN site.
Regards
Irfan.
-Original Message-
From: Dr.Ruud [mailto:[EMAIL PROTECTED]
Sent: Tuesday, August 19, 2008 2:03 PM
To: beginners@perl.org
Subject: Re: Execute the Linux command on remote m
Hi Jyotishmaan Ray
U can do the task in the following way but there may be some other good and
compact way.
The source file is the file where uid and user password are written but one
thing in the source file u need to keep uid and user passwd in the same
line. like this
s08-1-5-093 $1$2P6e6U
On Aug 18, 7:56 pm, [EMAIL PROTECTED] (Merdinus) wrote:
> The command that's causing this error is:
>
> my @refs = split('[', $references);
> I also tried >>> my @refs = split("[", $references); <<< (doublle
> quotes instead)
> and got the same error.
> If I change it to
>
> my
On Aug 18, 7:56 pm, [EMAIL PROTECTED] (Merdinus) wrote:
> The command that's causing this error is:
>
> my @refs = split('[', $references);
> I also tried >>> my @refs = split("[", $references); <<< (doublle
> quotes instead)
> and got the same error.
> If I change it to
>
> my
El Tuesday 19 August 2008 10:32:58 Dr.Ruud va escriure:
> Xavier Mas schreef:
> > m#(pattern)#;
> > $variable= $1.;
>
> That can be written as:
>
> ($variable) = /(pattern)/;
>
> --
> Affijn, Ruud
>
> "Gewoon is een tijger."
Thank you for pointing that, Dr. Ruud but, what does mean ($variable)?.
Arun schreef:
> What is wrong with this string.
>
> $send_data = (print strftime "::DATA::123456789101112,%d.%m.%y,%H:%M:
> %S,13.0076367,77.5489267,0,933.4,AirTel,31,0", gmtime);
X-Post alert: the message is also on clpm.
--
Affijn, Ruud
"Gewoon is een tijger."
--
To unsubscribe, e-mail: [E
"Irfan J Sayed (isayed)" schreef:
> I have downloaded the Math::Pari module and was trying to install but
> stuck
Let's go back to the start.
1. Show us the output of `perl -V`.
2. Run perl -MCPAN -e 'install Math::Pari'.
--
Affijn, Ruud
"Gewoon is een tijger."
--
To unsubscribe, e-mail:
Xavier Mas schreef:
> m#(pattern)#;
> $variable= $1.;
That can be written as:
($variable) = /(pattern)/;
--
Affijn, Ruud
"Gewoon is een tijger."
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
On Aug 13, 4:44 pm, [EMAIL PROTECTED] wrote:
> Hi,
>
> I am trying to search & replace a string in a file using the below
> perl command on unix.
>
> perl -pi -e 's/OLD/NEW/g' repltest.txt
>
> But I want the above command to display what lines were replaced. Is
> it possible using some switch opti
Hi,
I have downloaded the Math::Pari module and was trying to install but
stuck at one palce.following is the actual operation what I did:
I donloaded the Math module in /tmp dir. Please have a look below.
[EMAIL PROTECTED] Math-Pari-2.010800]$ pwd
/tmp/Math-Pari-2.010800
[EMAIL PROTECTED] Math-
El Tuesday 19 August 2008 01:17:59 Orson va escriure:
> I need to change perl script, but I am new to perl. Script is too long
> to copy here, but what I need is construct a reg ex pattern and store
> in variable. I need to concatenate this from many other variables.
> Then I must use this variable
On Tue, Aug 19, 2008 at 12:55 PM, Arun <[EMAIL PROTECTED]> wrote:
> What is wrong with this string.
>
> $send_data = (print strftime "::DATA::123456789101112,%d.%m.%y,%H:%M:
> %S,13.0076367,77.5489267,0,933.4,AirTel,31,0", gmtime);
>
>
print considers strftime as a file handler here.
you need prin
El Tuesday 19 August 2008 02:38:27 WetMogwai va escriure:
> I'm having trouble with a Perl script. I installed Mac::Growl through
> CPAN. It worked, but seemed to copy the final files to a place that
> doesn't exist. I can't find it now. When I run my script, it says it
> can't find Mac::Growl in @
Dear All,
I am a new bie in perl. I have to generate LDIF files
after reading a file containing a list of userids of a new admitted
batch of a university along with their passwords, uidNUmber And
gidNumber. Say the new batch contains 400 students, and the uidNumber
starts from the number 2631 onw
On Aug 15, 10:43 am, [EMAIL PROTECTED] (Rob Dixon) wrote:
> Rob Dixon wrote:
>
> > I am sorry, but even that work around won't help. I have downloaded a copy
> > of
> > Perl Express and I see that it is not running your script at all when you
> > are
> > debugging. If you look in $0 you will see
Orson schreef:
> what I need is construct a reg ex pattern and store
> in variable. I need to concatenate this from many other variables.
> Then I must use this variable to do a match. Something like this:
> while (<>)
> {
> chomp;
> my $pt = "\d" . "\s" . "\d";
This sets $pt to "dsd".
On Aug 13, 4:44 pm, [EMAIL PROTECTED] wrote:
> Hi,
>
> I am trying to search & replace a string in a file using the below
> perl command on unix.
>
> perl -pi -e 's/OLD/NEW/g' repltest.txt
>
> But I want the above command to display what lines were replaced. Is
> it possible using some switch opti
On Aug 13, 1:44 pm, [EMAIL PROTECTED] wrote:
> Hi,
>
> I am trying to search & replace a string in a file using the below
> perl command on unix.
>
> perl -pi -e 's/OLD/NEW/g' repltest.txt
>
> But I want the above command to display what lines were replaced. Is
> it possible using some switch opti
Merdinus schreef:
> my @refs = split('[', $references);
> Unmatched [ in regex; marked by <--- HERE .
The first parameter to split is a regex. The "[" character is a
functional regex character.
You can write it as:
my @refs = split /\[/, $references;
or as:
my @refs = split /[[]/
dear all,
i have arrays of number of size lets say 4000 i.e. 201000..2013999
now i want to do the following.
first print all the numbers to a colorful console. be it wx, tk, or web
based(this is what i am yet to know how i can i achieve)
then pick a winning number from the range which will
What is wrong with this string.
$send_data = (print strftime "::DATA::123456789101112,%d.%m.%y,%H:%M:
%S,13.0076367,77.5489267,0,933.4,AirTel,31,0", gmtime);
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/
58 matches
Mail list logo