explanation needed on sort using {$a<=>$b}

2001-11-11 Thread eventualdeath
@a= qw (68 3 5 67 54 23 69 ); @b = sort {-1} @a; ### what happens here ! results = 5,3,68,67,69,23,54 @c = sort {$a<=>$b} @a; ### what happens here ! results = 3,5,23,54,67,68,69 I know that sort by default sort in ascii order, I wanted to know what exactly happens to the "spaceship" operator.

Re: transforming an array of characters into 1 single string

2001-11-10 Thread eventualdeath
New Page 1< i'd like to know another way to do it, or another approach to reading the info from the databse file If I read you correctly, your datafile starts with : and ends with ø , therefore your data file would look like this :- :This is the first dataø :This is the second dataø :This is

Re: grep command

2001-11-08 Thread eventualdeath
To search inside a file, I believe you must open that file. Try this :- #!/usr/bin/perl -w open (FILE, "yourfile.any_ext"); @getdata = ; print "content-type: text/plain\n\n"; if (grep /yourmatch/, @getdata) { print @getdata; } else { print "Sorry ! couldn\'t find your match in the

Can I use split to split existing array !

2001-11-03 Thread eventualdeath
Hi, I need some clarification :- Q1)Can I use the split function to split an existing array (with several elements ) such as the example below. Q2)Could it be that the split function can only be used to split a scalar (one element). Q3)Could someone explain to me the reason why @

Re: Without modifications

2001-11-03 Thread eventualdeath
Yes you can! use activestate from http://activestate.com/ - Original Message - From: "pc" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Saturday, November 03, 2001 8:54 PM Subject: Without modifications > I need to learn how to program CGI applications on a Unix box. However, I > wo

Help needed on split & join function.

2001-11-02 Thread eventualdeath
Hi The script below does not do what I want which is to search a guestbook for a particular word and if that word appear, to show the records. Currently, after the script is run, it returns a blank page. I've confirmed that the fault lies with statement 1, in other words, if I replace statement1