Re: [Perl-unix-users] a way to put contents of variable at command prompt and pip it to some other command

2002-10-09 Thread Brian Noble

On Wed Oct 09, 2002 at 02:23:22PM -0700, Manish Tiwari wrote:
> Hi 
> 
> i was trying to do something like
> 
> @data = `ls -ltr ` ;

how about,

if defined(@data = `ls -ltr`){
   block of code
}

> 
> < do some operation check whether ls command actually worked> 
> 
> now i want to pass the contents of "data" thru unix commands like egrep and
> sort
> 
> 
> so in all operation will be like 
> 
> ls -ltr | grep -v total | sort +8
> 
> but making sure that ls command actually worked
> 
> 
> any help
> 
> 
> Thanx
> Manish

-- 
Brian Noble
Tech Support Engineer
[EMAIL PROTECTED]
___
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



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<\/A>/gi;}
> 
> 
> I need that $1 (in red) in the visible part of URL would be  max 40 characters, 
>while hyperlink actual path $1 be full length. Is there any way to make it.
> 
> Ideas appreciated,
> Roman.

-- 
Brian Noble
Tech Support Engineer
[EMAIL PROTECTED]
___
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs



Re: [Perl-unix-users] a question for split function in perl

2004-12-01 Thread Brian Noble
On Wed Dec 01, 2004 at 01:16:19PM -0800, Ella Cai wrote:
> Our codes is like this:
>  
> $line = "fordGID=54097";
> ($match,$data)=split(/[=]/,$line);

($match,$data)=split(/[=:]/,$line);  

> 
> Right now, sometime $line = "fordGID:54097";
> 
> I would like to know can split function support regular expression like if it 
> has either "=" or ":"?
> 
> Thanks
> 
> Lixin
> 
> 
>  
> 
>   
> -
> Do you Yahoo!?
>  Yahoo! Mail - Helps protect you from nasty viruses.
> ___
> Perl-Unix-Users mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
___
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs