Re: [Perl-unix-users] String Search

2002-10-18 Thread Henry Wong, ¶À³Ç¼e
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

RE: [Perl-unix-users] trim trailing spaces

2002-10-18 Thread BWilson
$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 ___

[Perl-unix-users] trim trailing spaces

2002-10-18 Thread Terry Vaughn
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

[Perl-unix-users] String Search

2002-10-18 Thread Pablo Morales
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  

Re: [Perl-unix-users] regexp question: $1 result (HTML formatted color-codedmail)

2002-10-18 Thread Joseph . Cumming
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

Re: [Perl-unix-users] regexp question: $1 result (HTML formatted color-coded mail)

2002-10-18 Thread Brian Noble
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<

[Perl-unix-users] regexp question: $1 result (HTML formatted color-coded mail)

2002-10-18 Thread Roman @ Melihhov
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

RE: [PMX:#] RE: [Perl-unix-users] a way to put contents of variable at comman d prompt and pip it to some other command

2002-10-18 Thread Manish Tiwari
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: