RE: why $000 is a valid variable name?

2004-11-18 Thread Jose Alves de Castro
On Thu, 2004-11-18 at 14:27, Larsen, Errin M HMMA/IT wrote: > BUT ... When I removed the "warnings" and "strict", and stopped using > "my", it works: replacing "my" with "our" does the trick too. -- José Alves de Castro <[EMAIL PROTECTED]> http://jose-castro.org/ -- To unsubscribe, e

Re: why to use 1)use CGI,2)use Strict ,3)use Carp in script

2004-11-04 Thread Jose Alves de Castro
On Thu, 2004-11-04 at 09:31, supriya devburman wrote: > hi Hi > why we r using > 1)use CGI, We only use CGI when we want to use methods from that module (usually on web pages); see `perldoc CGI` for more information on what you can do with it. > 2)use Strict, The correct name is strict. This i

Re: Accessing 2D array

2004-10-28 Thread Jose Alves de Castro
On Thu, 2004-10-28 at 10:19, Khairul Azmi wrote: > I've been trying to solve this problem using many techniques I found > on the websites but still unsuccessfully Hi. I don't have much time, so I probably won't be able to explain this right now, but here's a working version of your code, give it

Re: $_. and $_,

2004-10-13 Thread Jose Alves de Castro
On Wed, 2004-10-13 at 10:48, E.Horn wrote: > Hallo! Hi. > Stupid question, but i am a perlbeginner! :-( > What is the difference between $_. and $_, ?? $_ is a variable (the context variable) A single dot is the concatenation operator A single comma is the list separator So: $_. isn't really "

Re: OT: Email syntax validation

2004-10-05 Thread Jose Alves de Castro
On Mon, 2004-10-04 at 17:57, JupiterHost.Net wrote: > > > > When people undiscriminatingly advocate the use of modules whenever > > possible, I get unhappy. I'm using modules when I consider it to be > > suitable. > > > > Peace my friend, do whatever you want. > It wasn't an attack, that's what

Re: how do i describe a perl user?

2004-09-30 Thread Jose Alves de Castro
On Thu, 2004-09-30 at 17:07, Sano Babu wrote: > just wondering what a user of Perl may be called? I would call him a "very intelligent person" O:-) > "Perler"?? Theres > got to be some fancy name for it. Perl is not just another programming > language.. I reckon its much more like a religion with

Re: How Can I rename File using Perl?..

2004-09-30 Thread Jose Alves de Castro
On Thu, 2004-09-30 at 10:20, Roime bin Puniran wrote: > How can i rename any file using PERL?...Where should i start?..Where i can find any > tutorial? Try this perldoc -f rename HTH, :-) jac > This e-mail and any attachments may contain confidential and > privileged information. If you are n

Re: Need help with script

2004-09-30 Thread Jose Alves de Castro
On Wed, 2004-09-29 at 21:25, JupiterHost.Net wrote: > >>> I would like the output in the following format > >>> object1<...tab>Description1 > >>> object2<...tab>Description2 > >>> object3<...tab>Description3 > >> > >> > >> perl -lne 'BEGIN{$/="\n\n";}s/\n/\t/;print' FILENAME > > > > >

Re: How to access first key of "Hash of Hash"

2004-09-29 Thread Jose Alves de Castro
On Wed, 2004-09-29 at 15:32, Edward Wijaya wrote: > On 29 Sep 2004 15:20:39 +0100, Jose Alves de Castro > <[EMAIL PROTECTED]> wrote: > > > > > > for (keys %HoH) { > > print "$_\n"; > > } > > > > It seems so. Thanks a lot. Gla

Re: How to access first key of "Hash of Hash"

2004-09-29 Thread Jose Alves de Castro
On Wed, 2004-09-29 at 15:18, Edward Wijaya wrote: > On 29 Sep 2004 14:58:00 +0100, Jose Alves de Castro > <[EMAIL PROTECTED]> wrote: > > If I understood this correctly, you want to do this: > > > > So sorry for being not clear. > I will extend just a bit.

Re: How to access first key of "Hash of Hash"

2004-09-29 Thread Jose Alves de Castro
On Wed, 2004-09-29 at 14:37, Edward Wijaya wrote: > Hi, Hi. > I have this HoH: > my %HoH = ( > firstkey => { A => 'blabla', > B => 'dadada', > C => 'tititi',} > ); > > generated with > > $HoH{$fkey}{$alpha}=$text; > > how can I access the value > of

Re: Inline Edit -- File name

2004-09-22 Thread Jose Alves de Castro
On Wed, 2004-09-22 at 15:24, [EMAIL PROTECTED] wrote: > How will I get the file name when I do an inline edit like this: > > perl -i.orig -pe '$_ = $_' filename That won't compile, but I believe you're posting something like a proof of concept rather then code... If I get this correctly, you're

Re: HINT: regex coach

2004-09-08 Thread Jose Alves de Castro
On Wed, 2004-09-08 at 10:17, Ing. Branislav Gerzo wrote: > Hi, > > many of us need sometime fast help with regex. I recently found on the > web really nice and easy program. Maybe someone of you already know > it, for those, who don't it is REGEX COACH, download it from: > > http://www.weitz.de/r

Re: Foo (Bar)---I now see the light! (Or that which is made light of)

2004-09-08 Thread Jose Alves de Castro
From dictionary.com : Another common metasyntactic variable; see foo. Hackers do *not* generally use this to mean FUBAR in either the slang or jargon sense. According to a german correspondent, the term was coined during WW2 by allied troops who could not pronounce the german word "furchtbar" (

Re: Reading Multiple Lines

2004-09-08 Thread Jose Alves de Castro
On Wed, 2004-09-08 at 18:01, Eduardo Vázquez Rodríguez wrote: > Hello > > I am writing scripts that process big files which contains too many > lines (aproximately 700 000 lines per file). My strategy until now to > solve this problem is reading line per line, something like this > > while ()

RE: pulling out "a","an", "the" from beginning of strings

2004-08-24 Thread Jose Alves de Castro
On Tue, 2004-08-24 at 16:19, Bob Showalter wrote: > Jose Alves de Castro wrote: > > On Tue, 2004-08-24 at 15:04, Tim McGeary wrote: > > > I need to pull out articles "a", "an", and "the" from the beginning > > > of title strings so that th

Re: security on a html page with perl.

2004-08-24 Thread Jose Alves de Castro
On Tue, 2004-08-24 at 15:36, Chris Devers wrote: > On Tue, 24 Aug 2004, Jose Alves de Castro wrote: > > > On Tue, 2004-08-24 at 15:22, Chris Devers wrote: > > > >> The obvious way I can think of to do this is to make the download page a > >

Re: pulling out "a","an", "the" from beginning of strings

2004-08-24 Thread Jose Alves de Castro
On Tue, 2004-08-24 at 15:39, Chris Devers wrote: > On Tue, 24 Aug 2004, Jose Alves de Castro wrote: > > > On Tue, 2004-08-24 at 15:04, Tim McGeary wrote: > >> I need to pull out articles "a", "an", and "the" from the beginning of > >>

Re: security on a html page with perl.

2004-08-24 Thread Jose Alves de Castro
On Tue, 2004-08-24 at 15:22, Chris Devers wrote: > On Tue, 24 Aug 2004, Joe Echavarria wrote: > > > After a user fill out a form and submit it a perl > > script takes the user to a download page of my > > website. how can i prevent a user from directly > > access the download page using the web

Re: pulling out "a","an", "the" from beginning of strings

2004-08-24 Thread Jose Alves de Castro
On Tue, 2004-08-24 at 15:16, Tim McGeary wrote: > Jose Alves de Castro wrote: > > On Tue, 2004-08-24 at 15:04, Tim McGeary wrote: > > > >>I need to pull out articles "a", "an", and "the" from the beginning of > >>title strings so

Re: Between times

2004-08-24 Thread Jose Alves de Castro
On Tue, 2004-08-24 at 14:49, rmck wrote: > Hello, Hi > I have a script that I want to print only if between 08:00 and 17:00. Would I match > every hour then print?? Any cleaner way to do this would be great. Thanks > > my($sec,$min,$hour,$mday,$mon); > ($sec,$min,$hour,$mday,$mon)=localtime; I

Re: pulling out "a","an", "the" from beginning of strings

2004-08-24 Thread Jose Alves de Castro
On Tue, 2004-08-24 at 15:04, Tim McGeary wrote: > I need to pull out articles "a", "an", and "the" from the beginning of > title strings so that they sort properly in MySQL. What is the best way > to accomplish that if I have a single $scalar with the whole title in it? I would go with substitu

Re: pulling out "a","an", "the" from beginning of strings

2004-08-24 Thread Jose Alves de Castro
On Tue, 2004-08-24 at 15:04, Tim McGeary wrote: > I need to pull out articles "a", "an", and "the" from the beginning of > title strings so that they sort properly in MySQL. What is the best way > to accomplish that if I have a single $scalar with the whole title in it? I would go with substitu

Re: PERL and Mobile Devices.

2004-08-24 Thread Jose Alves de Castro
I know this is old stuff, but it might be interesting to some of you On Fri, 2004-08-13 at 14:33, James Edward Gray II wrote: > On Aug 10, 2004, at 3:35 PM, JupiterHost.Net wrote: > > > I remember hearing some cell phones had perl and maybe PDA's??? > > Really? I would be very interested to kno

Re: a bug of "-f" option?

2004-08-17 Thread Jose Alves de Castro
On Tue, 2004-08-17 at 10:18, Gunnar Hjalmarsson wrote: > Shu Hung wrote: > > I recently wrote a script with a '-f' file test inside. > > > > Normally, a '-f ' returns TRUE if a file with that > > filename exist. My script returns TRUE for all the files -- except > > the largest one (9.7 GB) on my

Re: awk like question

2004-08-13 Thread Jose Alves de Castro
e '$hash{$F[0]}=$F[1]; END{ # do something with %hash}' That should do the trick > --Errin > > On 13 Aug 2004 16:57:00 +0100, Jose Alves de Castro <[EMAIL PROTECTED]> wrote: > > On Fri, 2004-08-13 at 16:51, Errin Larsen wrote: > > > um, can anyone exp

Re: awk like question

2004-08-13 Thread Jose Alves de Castro
On Fri, 2004-08-13 at 16:51, Errin Larsen wrote: > um, can anyone explain the 'print' function below to me? > > specifically ... this: > > 'print "@F[0,5]"' The -a signal splits the input lines and stores the resulting elements in @F Example: perl -nae 'print "$F[1]\n"' file.txt where file.

Re: set operations on arrays

2004-08-13 Thread Jose Alves de Castro
On Wed, 2004-08-11 at 18:13, Christopher J. Bottaro wrote: > is it possible to do set opperations on arrays? any cpan module or > anything? i want to do something like the following: Yes, it is possible. http://search.cpan.org/~muenalan/Class-Maker-0.05.18/Maker/Examples/Array.pm or, if you're

Re: checking all pieces of split data for NULL

2004-08-10 Thread Jose Alves de Castro
On Tue, 2004-08-10 at 15:01, Tim McGeary wrote: > I have a file of data that I want to safety check to ensure that there > is data for each piece of the line being split. Is there a fast way to > say "If any of these are '' then write to error log"? Let's say you have your line split in @line

Re: File Size Calculator

2004-08-09 Thread Jose Alves de Castro
On Mon, 2004-08-09 at 14:53, David Dorward wrote: > On 9 Aug 2004, at 14:34, SilverFox wrote: > > > Hi all, I'm trying to writing a script that will allow a user to enter > > a > > number and that number will be converted into KB,MB or GB depending on > > the > > size of the number. Can someone

Re: What is this doing: eval 'exec /usr/bin/perl -T -w -S $0 ${1+"$@"}' if 0;

2004-08-09 Thread Jose Alves de Castro
On Sun, 2004-08-08 at 04:06, JupiterHost.Net wrote: > I found this code in a script right after the she-bang line: > > eval 'exec /usr/bin/perl -T -w -S $0 ${1+"$@"}' > if 0; # not running under some shell > > What is it doing? Hi. From `perldoc perlrun`, under -S : Typically this is used

Re: Perl oneliner to delete lines from a file

2004-08-09 Thread Jose Alves de Castro
On Mon, 2004-08-09 at 07:34, Ramprasad A Padmanabhan wrote: > I want to write a command line perl 'script' to delete one or more > lines from a file , by line number Hi :-) If I understand correctly, you want to delete lines X to Y from a file, right? perl -i -ne 'print unless 1..10' file tha

Re: doubt in Definition of sub routine.

2004-08-05 Thread Jose Alves de Castro
On Thu, 2004-08-05 at 11:07, [EMAIL PROTECTED] wrote: > Hi All, Hi > I am using code written by some one else. I didn't understand the difference > between these subroutines, the way they were defined. > > 1. sub addToLog { Some code } Any specific reason where we should > not use braces

Re: Return values of "system"

2004-08-03 Thread Jose Alves de Castro
On Mon, 2004-08-02 at 14:52, Prasanna Kothari wrote: > Hi, Hi > [... code ...] I have tried your code and it works... > Notice that the code snippet is executing vi with a file and hence > editor opens up the file. After typing if I give a wrong vi command for > eg: "W" instead of "w"; $val g

Re: $^T inconsistant?

2004-07-08 Thread Jose Alves de Castro
Does it vary randomly, or does it just change after a while and stick with the new value? I've tried in on my RH and it works fine... :-| Thoughts, anyone? jac On Thu, 2004-07-08 at 17:25, perl.org wrote: > I am doing something like: > > ( $data{sec}, $data{min}, $data{hour}, $data{day}, $data

RE: Cron Tab Implementation

2004-07-08 Thread Jose Alves de Castro
You should take a look at: Config::Crontab (I found this to be helpful, in the past) and http://www.webmin.com/ (if memory doesn't fail me, it is written in Perl, and it may suffice your needs...) HTH, jac (back again) On Thu, 2004-07-08 at 17:53, NandKishore.Sagi wrote: > Actually I had a lot

Re: Program to scan dictionary for words with letters in a particular set?

2004-05-27 Thread Jose Alves de Castro
On Thu, 2004-05-27 at 11:21, Ramprasad A Padmanabhan wrote: > On Thu, 2004-05-27 at 15:09, Jose Alves de Castro wrote: > That was simply neat. I had read in a perl book ' there is always a > shorter way in perl '. I think this proves it. > > But to think of it there is

Re: Line number

2004-05-27 Thread Jose Alves de Castro
On Thu, 2004-05-27 at 10:10, Jon Herbry wrote: > Hi, anybody have idea find the number in a file? Assume I create a file call "sample" > and have content below: > > Hi, Jame where are you? > How old are you? > when you free? > can you coming my home? > -

Re: Program to scan dictionary for words with letters in a particular set?

2004-05-27 Thread Jose Alves de Castro
On Thu, 2004-05-27 at 06:14, Jim Witte wrote: > Given a file of words W such as 'cat dog at home ...' (or perhaps read > into an array, though that would be a very large array), and a set of > letters L (a string 'aoeuidhtns' - perhaps put into a array), how would > I write a program to extract

Re: Array help almost correct

2004-05-26 Thread Jose Alves de Castro
On Wed, 2004-05-26 at 15:07, willy.k wrote: > Jose > > Many thanks for replying so quickly. > I will explain again, sorry but is complicated. > > > > ### > I have an array called group_vals. > > This array can be populated by any combination of values > e.g. /sp|lp|e

Re: Array help needed please

2004-05-26 Thread Jose Alves de Castro
On Wed, 2004-05-26 at 12:05, William Kolln wrote: > This is a previous message from April left unanswered. > > > Can Anyone Help...thanks if you can! > > > > I have an array called group_vals. > > This array can be populated by any combination of values > e.g. /sp|lp|ep12|ffp|vid|dvd|bx|

Re: need help(urgent)

2004-05-26 Thread Jose Alves de Castro
On Wed, 2004-05-26 at 12:09, Jose Alves de Castro wrote: > > What I am supposed to do is > > > > 1) parse a file and search for included files and insert those > > included files in the file. Lets get step by step with my solution (just so you understand what

Re: need help(urgent)

2004-05-26 Thread Jose Alves de Castro
On Wed, 2004-05-26 at 11:49, Girish N wrote: > Hi All > > I am stuck with this script which I need to finish today... > > > > What I am supposed to do is > > 1) parse a file and search for included files and insert those > included files in the file. > > Eg. > > File1 > > Lkdfs > >

Re: get hash from array

2004-05-24 Thread Jose Alves de Castro
On Mon, 2004-05-24 at 14:09, Jose Alves de Castro wrote: > On Mon, 2004-05-24 at 13:46, [EMAIL PROTECTED] wrote: > > sub xpto { > >my %a = map {$_ => undef} (@_); > >return \%a; > > } > > > > or > > > > sub xpto { > >re

Re: get hash from array

2004-05-24 Thread Jose Alves de Castro
On Mon, 2004-05-24 at 13:46, [EMAIL PROTECTED] wrote: > sub xpto { >my %a = map {$_ => undef} (@_); >return \%a; > } > > or > > sub xpto { >return {map {$_ => undef} (@_)}; > } > > > I'm using this code but shall exist someting clearner without map. Can you > help me? If what you

Re: matrix solving

2004-05-21 Thread Jose Alves de Castro
Try using Math::Matrix (you can find it on CPAN) On Fri, 2004-05-21 at 11:18, Boon Chong Ang wrote: > Hi, > I want to use perl to do the matrix solving such as matrix inversion and and matrix > multiplication, matrix addition and matrix substraction. However, i have no idea how > to do it in pe

Re: pointer to another list?

2004-05-21 Thread Jose Alves de Castro
For a list of lists, you might want to try http://lists.perl.org/ On Thu, 2004-05-20 at 18:58, JupiterHost.Net wrote: > Hello group! > > Anyone have any idea of a mailing list or more resources about embedding > Perl in C like is discussed here: > http://www-h.eng.cam.ac.uk/help/mjg17/perldo

Re: regex alternation question

2004-05-21 Thread Jose Alves de Castro
On Thu, 2004-05-20 at 21:22, Rich Fernandez wrote: > I'm unclear about how alternation works in a regex. > > Say I want to find either "foo" or "bar" within a string. I don't care which > one I match, only that I make a match. > Would this be correct: /foo|bar/ > > Should they be grouped thusl

Re: regular expr.

2004-05-20 Thread Jose Alves de Castro
On Thu, 2004-05-20 at 12:16, Singh, Ajit p wrote: > Hello everybody, > > My problem is that I have a define a variable which combines two other > variables with preceeding zeroes. > > i.e final_variable : <3 digit var1><5 digit var2> > > if var1 is single digit i have to preceed it with two zer

Re: regex string modification

2004-05-20 Thread Jose Alves de Castro
On Thu, 2004-05-20 at 01:21, meb wrote: > Maybe this is because I'm a newbie, or maybe it's because I'm trying to > modify RSS text. This is a perl script for a web site. > > In any case, there's a feed that includes the author at the end of the > (looong) description. I'd like to limit the decsri

Re: regexp

2004-05-19 Thread Jose Alves de Castro
On Wed, 2004-05-19 at 15:52, Graf Laszlo wrote: > Hi Hi > I have the following HTML structure: > > > > BBB > > > CCC > > > > Every line in this structure is an element of an array, > named @lines, and I access the elements using a foreac

Re: Query

2004-05-19 Thread Jose Alves de Castro
On Wed, 2004-05-19 at 06:59, [EMAIL PROTECTED] wrote: > I am using the below command > > awk -F: ' $3 ~/bharghav/ { print $0 } ' data.file > > but this command produces both > Vijayb:12345:Vijay B bharghav > vijaya:12347:vijaya bharghavi > > what to if I want only record containing exactly the w

Re: using Sleep instead of Cron

2004-05-18 Thread Jose Alves de Castro
On Tue, 2004-05-18 at 16:02, [EMAIL PROTECTED] wrote: > Hi all, > > I'm writing a script which fetches data every hour. I thought instead of > using cron which is platform dependent, to use sleep and a goto statement. Is > there any downfalls to this? Other downfalls: - Cron has automatic e-

Re: using Sleep instead of Cron

2004-05-18 Thread Jose Alves de Castro
On Tue, 2004-05-18 at 16:02, [EMAIL PROTECTED] wrote: > Hi all, > > I'm writing a script which fetches data every hour. I thought instead of > using cron which is platform dependent, to use sleep and a goto statement. Is > there any downfalls to this? Yes. With sleep, once the machine is res

RE: Query

2004-05-18 Thread Jose Alves de Castro
ue, 2004-05-18 at 12:28, Sudhindra Bhat wrote: > Hi > > This doesn't seem to work. I get a blank output. But yes the output that is > want is > > 123456 ABCDEF > 123456 > > Regards, > Sudhindra > > -----Original Message- > From: Jose Alves de Ca

Re: Query

2004-05-18 Thread Jose Alves de Castro
On Tue, 2004-05-18 at 07:36, Sudhindra Bhat wrote: > Hi > > Thanks. But there is a small issue. Considering the same example, the piece > of code sent by you prints 123456 which is not on the same line as "Test:" > But it doesn't print the characters 123456 ABCDEF which is on the same line > as "T

Re: inline editing of files, searching for \n\n\n

2004-05-10 Thread Jose Alves de Castro
> The first one does weird stuff Looks like -i only works with '<>', not with '' (though I could not find that documented). > Can you tell me how to change the first one to make it work? If you really need to do that, try 'open(STDIN,$filetobechanged)' instead. Then, 'while(<>)' instead of 'whil

Re: split

2004-05-06 Thread Jose Alves de Castro
On Thu, 2004-05-06 at 12:32, jack jack wrote: > it is not printing anything?? My program is as follows: > $var1=`cleartool lsview -l av_test `; #here output is # *av_test > #\hostname\views\av_test.vws /(.*?)\\/; print $1; Ok, try this $var1 = `cleartool lsview -l av_test`; $var1 =~ /\\(.*?)

Re: split

2004-05-06 Thread Jose Alves de Castro
On Thu, 2004-05-06 at 08:15, jack jack wrote: > Hi All, > > I have an output from a cammand > I have to split and get only hostname in below output > Why split, when you can match? :-) > * av_test \\hostname\views\av_test.vws /(.*?)\\/ and now the variable $1 holds the hostna

RE: Problem changing the content of a file

2004-05-05 Thread Jose Alves de Castro
On Wed, 2004-05-05 at 15:40, Layani, Roger wrote: > when I open the file like : > open(RELFILE,">$file") || die ("error opening file \"$file\""); When you open the file to write to it, the file is cleaned (0 bytes). > .. > and print the change in sam efiel I get a 0 size file . > > @array =

Re: pattern match question

2004-05-05 Thread Jose Alves de Castro
/(?<=Retrieval command for )http:.*?:/){ > > It prints off the "Retrieval command for" part as it did before :( > > > any ideas? > > > Cheers, > > Graeme :) > > > > >From: Jose Alves de Castro <[EMAIL PROTECTED]> > >To: Gr

Re: pattern match question

2004-05-05 Thread Jose Alves de Castro
I would do /(?<=Retrieval command for )http:.*?:/ The "Retrieval" part now is contained in a "Look behind section", which is to mean it's not going to be stored as part of the match. I'm not sure what other cases you can get in that log file, but this solves the problem for that particular line

re: Extracting number from string

2004-05-04 Thread Jose Alves de Castro
If I was taking all the digits out (result would be 123400), I would do: y/0-9//cd; This takes all the characters not in [0-9] and deletes them. On Mon, 2004-05-03 at 19:58, William Black wrote: > Hello All, > > I need a regular expression to extract only the number from the below > string.

RE: Newbie: regular expression

2004-05-03 Thread Jose Alves de Castro
On Mon, 2004-05-03 at 10:58, Traeder, Philipp wrote: > For the record: > If you want to strip trailing newlines, use chomp. > If you want to strip newlines anywhere else, use regexes. And, if you want to strip trailing characters (no matter what they are; let's say you know there's always a traili

Re: Newbie: regular expression

2004-05-03 Thread Jose Alves de Castro
On Mon, 2004-05-03 at 11:02, Owen wrote: > What happens if you try s/\\n/HI/ > (untested) That would replace a backslash followed by the 'n' character with "HI". >From the original message: $_="Hi. \n This is test string"; So there is no backslash followed by an 'n' in $_ (actually, there isn'

RE: Newbie: regular expression

2004-05-03 Thread Jose Alves de Castro
On Mon, 2004-05-03 at 10:46, Traeder, Philipp wrote: > chomp might be the easiest (and probably fastest) solution. True :-) But the '\n' he was looking for was in the middle of the sentence :-) BTW, I kept the trailing 'g' in the substitution just because I didn't knew what the input text might b

Re: Newbie: regular expression

2004-05-03 Thread Jose Alves de Castro
Hi. The problem is that the second part of the substitution (HI) is not taken as a regex, but as a string, which is to mean that you're trying to replace "\n" with "HI\n". If you were using s/ (\n) /HI/xisg; instead, you wouldn't have that problem. Now that we've been through the problem, le

Re: Running another program in current program

2004-04-29 Thread Jose Alves de Castro
I must agree with James :-) Most times I post, I usually tend to solve the main problem without caring about the others, but I should really make an effort and act a little more like him :-) jac On Thu, 2004-04-29 at 14:25, James Edward Gray II wrote: > On Apr 29, 2004, at 5:53 AM, Durai wrote:

Re: Running another program in current program

2004-04-29 Thread Jose Alves de Castro
exit > fi > > What is the equivalent code in perl for above shell script? > > Thanks, > Durai. > > - Original Message - > From: "Jose Alves de Castro" <[EMAIL PROTECTED]> > To: "Durai" <[

Re: Running another program in current program

2004-04-29 Thread Jose Alves de Castro
>Thanks for the reply. Sorry for asking this one. But how to run > another perl prog? > > Should I have to use system() function? Or is there any other way? > > Thanks, > Durai. > > ----- Original Message - > From: "Jose Alves de Castro" <

Re: Running another program in current program

2004-04-29 Thread Jose Alves de Castro
It's the same variable :-) $? The status returned by the last pipe close, backtick (``) com- mand, successful call to wait() or waitpid(), or from the sys- tem() operator. For more info, man perlvar If you care to give it a test, here it goes: perl -e '`ls`;print $?' # prin

Re: Substitution/Regex problem

2004-04-29 Thread Jose Alves de Castro
The problem is that your regex is matching the whole line: @ [EMAIL PROTECTED]@banana[4]; ^ ^ $1 $2 Instead, use non greedy matches: $line =~ s/(@)(\S+?\[\S+?\])/\$$2/g; and you'll get what you want: @ array[1] = @ array[2] +@ banana[4]; ^ ^

Re: Flag for script

2004-04-16 Thread Jose Alves de Castro
Also, take a look at this: #!/usr/bin/perl -s use strict; our $h; if ($h) { print "this is a very special feature"; } The -s switch "interprets -xxx on the command line as a switch and sets the corresponding variable $xxx in the script to 1." There's also something else, which I leave for you