have you tried using CPAN module Config::IniFiles ?
http://search.cpan.org/author/WADG/Config-IniFiles-2.30/IniFiles.pm
otherwise try
open (FH, $ARGV[0]);
my %config;
foreach () {
my ($key, $value) = split "=", $_, 2;
$config{$key} = $value;
}
print $config{'CD_ROM'},"\n";
--- Pablo Mora
$var =~ s/\s+$//;
-Original Message-
From: Terry Vaughn [mailto:tvaughn@;dakotagrowers.com]
Sent: Friday, October 18, 2002 3:03 PM
To: [EMAIL PROTECTED]
Subject: [Perl-unix-users] trim trailing spaces
Hello. What's the quickest way to trim trailing spaces from a variable ??
Terry
___
Hello. What's the quickest way to trim trailing spaces from a variable ??
Terry
___
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Hi there people.
I've gotta question.
I've read a line from a file and asign it to
a variable, the variable contains the following
CD_ROM=/path/of_cdrom
I want to retrieve the last patern ,
"/path/of_cdrom", and asign it to a variable
How can I do that?
Lotta Thanx
Roman,
You don't need to do the substitute the second time. The first match will
populate the $1 & $2 variables as intended and you can then manipulate them
then as you wish in the subsequent expression:
if ($k_7 =~ /^(www\.(\S+|$))/i)
{
$k_7 = "" .
subtr($2, 0, 40) . "<\/A>";
}
Joe
Use the substr function.
On Fri Oct 18, 2002 at 06:00:03PM +0300, Roman @ Melihhov wrote:
> Sup,
>
> I know how to match certain length patterns, but is there any way to return only
>certain amount of the $1
>
> if ($k_7 =~ /^(www\.(\S+|$))/i)
> {$k_7 =~ s/(www\.(\S+|$))/target=\"_blank\">$1<
Sup,
I know how to match certain length patterns, but is
there any way to return only certain amount of the $1
if ($k_7 =~ /^(www\.(\S+|$))/i) {$k_7 =~
s/(www\.(\S+|$))/$1\"
title=\"$1\" target=\"_blank\">$1<\/A>/gi;}
I need that $1 (in red)
in the visible part of URL would be max
Title: RE: [PMX:#] RE: [Perl-unix-users] a way to put contents of variable at comman d prompt and pip it to some other command
Thanx Brian and all for helping me out
Regards
Manish
-Original Message-
From: Brian Noble [mailto:[EMAIL PROTECTED]]
Sent: Thursday, October 10, 2002 10: