Hi all
Thanks alot that works fine.
Regards
anand
Jeff Pang <[EMAIL PROTECTED]> wrote:
hello,I wrote it as below simply,maybe it's not so good,you could modify it.
use strict;
use warnings;
my %hash;
while(<>)
{
next if /^$/;
if (/Name\s+(.*)$/)
{
my $name = $1;
my $age = $1 if (
hello,I wrote it as below simply,maybe it's not so good,you could modify it.
use strict;
use warnings;
my %hash;
while(<>)
{
next if /^$/;
if (/Name\s+(.*)$/)
{
my $name = $1;
my $age = $1 if ($_ = <>) =~ /AGE\s+(.*)$/;
my $book = $1 if ($_ = <>) =~ /Book\s+(.
On 2/15/06, anand kumar <[EMAIL PROTECTED]> wrote:
> can anyone help me on how to store the data with hash key as the 'Name'
> and the hash strings as the details of 'AGE' and 'Book'
Perl's hashes use a single key to look up a single value. So, to keep
this simple, you can use two hashes, %age
Hi ,
Thanks for the reply. but can u help me out if the data is large and need a
loop to store(also if possible give instructions if the record has variable or
optional number of fields).
Jeff Pang <[EMAIL PROTECTED]> wrote:
Name ABC
AGE 25
Book perl
Name DEF
AGE 20
Book linux
Name GHI
Name ABC
AGE 25
Book perl
Name DEF
AGE 20
Book linux
Name GHI
AGE 21
Book PHP
.
can anyone help me on how to store the data with hash key as the 'Name' and
the hash strings as the details of 'AGE' and 'Book'
Hello,I think you could do it as followin
Hi all
while learning hash arrays i have got a doubt i.e if the data is
in the following manner
Name ABC
AGE 25
Book perl
Name DEF
AGE 20
Book linux
Name GHI
AGE 21
Book PHP
.
..
(assume that the above dat
On 2/15/06, Mohammed Shameer <[EMAIL PROTECTED]> wrote:
> Can there be a setuid perl script which when executed, runs with the
> privileges of owner of the file
> ie:-
> I am root
> chown root:root /bin/myscript.pl
> chmod +s /bin/myscript.pl
>
> Now I am a local user
> /bin/myscript.pl
>
> and m
Hi,
Can there be a setuid perl script which when executed, runs with the
privileges of owner of the file
ie:-
I am root
chown root:root /bin/myscript.pl
chmod +s /bin/myscript.pl
Now I am a local user
/bin/myscript.pl
and myscript.pl contains some code which need root privileges to run.
O
I download a daily radio show. I would like to use Perl to automatically
rename the file, cut out the commercials (at known intervals) and then
rejoin the cut pieces. I looked at CPAN for MP3 tools and found one that
will split files (MP3::Split) but not one that would join them.
Does anyone ha
You can try making a hash of names out of file C (just set $hash{$name}
= 1;), and then just check each name with
unless($hash{$name}){
do something...
}
-Original Message-
From: Andrej Kastrin [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 15, 2006 8:29 AM
To: beginner
On 2/15/06, Tom Phoenix <[EMAIL PROTECTED]> wrote:
> On 2/14/06, nishanth ev <[EMAIL PROTECTED]> wrote:
>
> > I want to start and stop a serviec using cgi script.
>
> Thanks for including your new code. It doesn't seem to change anything
> important, though. Have you tried any of the suggestions yo
On 2/14/06, nishanth ev <[EMAIL PROTECTED]> wrote:
> I want to start and stop a serviec using cgi script.
Thanks for including your new code. It doesn't seem to change anything
important, though. Have you tried any of the suggestions you've
already gotten? Did you use $< and $> to learn what user
Dear Perl users,
I have some problems wih the folowing algorithm:
File A:
-
ID - 001
AD - Bill
AD - Castro
AD John
ID - 002
AD - Andrew
AD - Mike
etc.
-
Then in the second file I have some values for each AD:
-
Andrew - 10
Bill - 20
Do I spot a space between ricerche/ and VALICO1497.pl?
Is that space also in $nf?
> Can't locate
> /Library/WebServer/CGI-Executables/
e-allora/enter/ricerche/ VALICO1497.pl
Try print "<$nf>";
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTE
Il giorno 14/feb/06, alle 22:16, Tom Phoenix ha scritto:
[...]
Better yet, use absolute pathnames, not relative ones, to locate code.
That's for security reasons.
quite strange: I launched the perl script in this odd-way (to test if I
was in the correct directory):
adrianoallora$
/Libra
> Please help me on the following code. The code is supposed to receive to
> words "cool" and "cash" plus a number from 0 to 10, with optional spaces
> between the words.
Well, is the program argument quoted then? Like
./your_program "arg1 still arg1"
Or is it actually that cash is in $ARGV[2] and
"John W. Krahn" <[EMAIL PROTECTED]> wrote:anand kumar wrote:
> Hi all,
Hello,
> I have the following problem in the following regex replace.
>
> $line=~s!\b($name)\b!$1!g;
>
> here this regex finds the exact matching of the content in $name and does
> the needed but in some examples the v
Tom Phoenix am Mittwoch, 15. Februar 2006 01.59:
> On 2/14/06, Hans Meier (John Doe) <[EMAIL PROTECTED]> wrote:
> > I'm fine with that, but still don't understand how a path present in @INC
> > is ignored.
>
> It sure looks like it's in @INC, from the message. (You may know that
> PERL5LIB is somet
18 matches
Mail list logo