Re: Simpler....

2001-12-04 Thread Hasanuddin Tamir
On Wed, 5 Dec 2001, Daniel Falkenberg <[EMAIL PROTECTED]> wrote, > Hey all, > > Please don't stree to much over this one but, is there an easier way of > writing this? > > while(1){ > if ($status == 1) { > #Do this sub... > sub(); > elsif ($status == 1) { > #Do this other sub...

RE:Whats wrong with unlink?

2001-12-04 Thread Hasanuddin Tamir
On Tue, 4 Dec 2001, Jorge Goncalvez <[EMAIL PROTECTED]> wrote, > Hi, I wanted to delete all files under a directory but not the directory > I tried this: > my ($_path) = "c:/EventLogs/"; > unlink $_path if -r $_path; > > But it didn't delete teh files which are under the directory Eventslogs >

Re: replace char n times

2001-12-03 Thread Hasanuddin Tamir
On Mon, 3 Dec 2001, Mark Hanson <[EMAIL PROTECTED]> wrote, > Hi gurus! > > I want to use the quantifier {COUNT}? in the following program to remove the first >three underscores. I'm trying to avoid a loop. I have not been able to figure out the >syntax. > > $a = "The_quick_brown_fox_jumped_ov

RE:delete all files under a directory

2001-12-03 Thread Hasanuddin Tamir
On Mon, 3 Dec 2001, Jorge Goncalvez <[EMAIL PROTECTED]> wrote, > Hi, I wonder How to delete all files under a directory in Perl > Thanks. This one does it, but not recursively, and only real files, not directories. perl -e 'unlink <*>' san -- Trabas - http://www.trabas.com -- To unsubsc

Re: perl and html tables?

2001-11-30 Thread Hasanuddin Tamir
On Fri, 30 Nov 2001, Craig Sharp <[EMAIL PROTECTED]> wrote, > I need to create a script that will use DBI to retreive information from Informix >and then present the information in a table in html. > > The DBI part I have with no problem. > > I need to use perl to create a table in html that

Re: Question

2001-11-28 Thread Hasanuddin Tamir
On Wed, 28 Nov 2001, Kevin Meltzer <[EMAIL PROTECTED]> wrote, > > What is the difference between mysql and MySQL (case sensitivity)? > > Unless I missed a new product along the line, mysql is just a non-correct-case > for MySQL. Doesn't anyone ever use the mysql client for MySQL? san@pts2

Re: open read write

2001-11-28 Thread Hasanuddin Tamir
On Wed, 28 Nov 2001, Ahmed Moustafa Ibrahim Ahmed <[EMAIL PROTECTED]> wrote, > Hi Nafiseh, > > I think can't open a file for reading and writing at the same time. > Anyway, the following should help: > > #-- > open (FILE, $file) || die "Can't open $file: $!\n"; > $v

Re: Config file regex...

2001-11-27 Thread Hasanuddin Tamir
On Wed, 28 Nov 2001, Daniel Falkenberg <[EMAIL PROTECTED]> wrote, > Hey all, > > [Config File] > Linux Passwd File = /etc/passwd > New File = /home/test > Old File= /home/test > Company Name = Company Name > Compan

RE:help on Regex

2001-11-27 Thread Hasanuddin Tamir
On Tue, 27 Nov 2001, Jorge Goncalvez <[EMAIL PROTECTED]> wrote, > Hi I have this: > > my $ip="192.40.54.41"; > > $ip=~ s/(\d+\.\d+)\.(\d+\.\d+)/$1\.0/; > > print $ip; > > But It didn't work it displays 192.40.0 and I wanted to display 192.40.54.0. > Why? thanks. The first parentheses (refere

Re: function

2001-06-29 Thread Hasanuddin Tamir
On 29 Jun 2001, Chas Owens <[EMAIL PROTECTED]> wrote, > On 29 Jun 2001 11:31:51 +0200, BHEEKOO,KHALIL (HP-SouthAfrica,ex1) > wrote: > > Hi all > > Why do you think you need getlogin? Getlogin does not accept any > arguments and returns the name of the currently logged in user. Are you > looking

Re: Taint checking with -T

2001-06-29 Thread Hasanuddin Tamir
On Fri, 29 Jun 2001, dave hoover <[EMAIL PROTECTED]> wrote, > When I added -T to an existing Perl script, I got the > error message: > > Too late for "-T" option at main.cgi line 1. > > Is this a common error message with -T? What am I > doing wrong? Usually yes, when you invoke the script from

Re: Matching strings

2001-06-28 Thread Hasanuddin Tamir
On Thu, 28 Jun 2001, twelveoaks <[EMAIL PROTECTED]> wrote, > Peter Scott Wrote: > > > my %h; > > @h{@vars} = (); > > if (keys %h != @vars) { $youlose = "yes"; } > > > Maybe I'm missing something - won't these *always* match, since @vars has > been used to create keys %h? No, depends on the conte

Re: Input redirection

2001-06-28 Thread Hasanuddin Tamir
On Thu, 28 Jun 2001, jaya kumaran <[EMAIL PROTECTED]> wrote, > Hi, > > I need the o/p of > perl -v >to be redirected to a file test.txt > > open(FILEHANDLE,"> test.txt") || die can't open the file"; ^ |

Re: Clear screen

2001-06-28 Thread Hasanuddin Tamir
On Wed, 27 Jun 2001, jaya kumaran <[EMAIL PROTECTED]> wrote, > Hi all, > >I used this instruction to clear the screen on NT > >system(cls); >print "Hello"; > > the same instruction is not working on unix. I modified the instruction to > > system(clear); > print "hello"; > > This

Re: Best practice for config file use?

2001-06-28 Thread Hasanuddin Tamir
On Wed, 27 Jun 2001, Michael Fowler <[EMAIL PROTECTED]> wrote, > On Wed, Jun 27, 2001 at 06:58:37PM +0200, Jos I. Boumans wrote: > > I usually use a config file for this > > now you could do this 3 ways as i see it > > > > -just have a file that holds a lot of global vars and 'require/use' th

Re: Converting Unix paths to windows

2001-06-28 Thread Hasanuddin Tamir
On Wed, 27 Jun 2001, Daryl Hoyt <[EMAIL PROTECTED]> wrote, > Hi, > I am writing a script to be used on Windows and many different > flavors of Unix. I am looking for a good way to convert Unix paths > to Windows. Any Ideas? use File::Spec; I know your question is about "conver

Re: Finding @INC

2001-06-27 Thread Hasanuddin Tamir
On Wed, 27 Jun 2001, Maxim Berlin <[EMAIL PROTECTED]> wrote, > Hello Dennis, > > Tuesday, June 26, 2001, Dennis Fox <[EMAIL PROTECTED]> wrote: > > DF> My difficulty is that I don't understand how to modify @INC to > DF> include the non-standard locations, so that I don't have to have the

Re: Srting matching again

2001-06-26 Thread Hasanuddin Tamir
On Tue, 26 Jun 2001, Yvonne Murphy <[EMAIL PROTECTED]> wrote, > if ($mymatch =~ m/\'(.+)\;/gis) { #matches anything between the single ^^ > > > But the problem occurs when I add this into a bigger code segment, it > just goes crazy! And seems to match te complete opp

Re: sort by value?

2001-06-26 Thread Hasanuddin Tamir
On Tue, 26 Jun 2001, Mark Bedish <[EMAIL PROTECTED]> wrote, > I have a very simple tab delimited file containing text and numbers , > just the 2 columns and I would like to sort by ascending numeric. I have > checked Learning Perl and Prog Perl but cannot get it to work - is that > because you ca

Re: Special Variable for name of the running script

2001-06-14 Thread Hasanuddin Tamir
On Fri, 15 Jun 2001, Charles Lu <[EMAIL PROTECTED]> wrote, > My question is is there perl special variable that stores the name of the > actualy script that is running? In other words, which variable, if any > holds the value "myscript.pl"? $0 perldoc perlvar __END__ -- s::a::n->http(www.tr

Re: php -> perl

2001-06-14 Thread Hasanuddin Tamir
On Wed, 13 Jun 2001, Michael Cartwright <[EMAIL PROTECTED]> wrote, > However, I need it in Perl. Could someone help me with what would this look > like in Perl? > > Thanks, > Michael > > $FileName=$HTTP_GET_VARS["FileName"]; > > if(!$FileName) > { > $FileName="example"; > } > $FileName.="

Re: converting standard input to an upper or lower case

2001-06-12 Thread Hasanuddin Tamir
On Tue, 12 Jun 2001, John Fox <[EMAIL PROTECTED]> wrote, > Evgeny, > > Verily, on Wednesday June 13, 2001, the Sainted Evgeny Goldin (aka Genie) spake: > > Don't try to push regexes whenever you can - eq, index, substr > > may do a lot for you. > > Is the moral of this story "Don't use regexps un

Re: checking the status of FileHandle

2001-06-12 Thread Hasanuddin Tamir
On Tue, 12 Jun 2001, Charles Lu <[EMAIL PROTECTED]> wrote, > my $oldhandle=undef; > if($user_input ne 'STDOUT') { #user specify output to a file > open (OUT,">$temp.txt") or die "Can't open the file\n"; > $oldhandle = select OUT; > } > > print "blah blah blah\n"; > > select ($ol

Re: what does perl do internally when filehandles are undefined?

2001-06-12 Thread Hasanuddin Tamir
ANDLE. Perl refuses to print to undefined filehandle, or, undefined file descriptor. Or, more presicely: it only prints to opened filehandle and only opened for output. You can check the file descriptor using fileno() on STDOUT (1), opened filehandle (usually > 2), and ACT_AS_FILEHANDLE (undef)

Re: what does perl do internally when filehandles are undefined?

2001-06-12 Thread Hasanuddin Tamir
On Tue, 12 Jun 2001, Avram Aelony <[EMAIL PROTECTED]> wrote, > Hi, > > I commonly make use of statements like: print OUTFILE "Print > results, data, or anything else\n"; > This is normally preceded by defining my file handle, as in something > like: open(OUTFILE, ">newfile.txt"); > > I'd

Re: checking for the @ symbol

2001-06-12 Thread Hasanuddin Tamir
On Tue, 12 Jun 2001, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote, > > print "You're cheating!" if($add_alias =~ /[^\w\.\-]/g); # \w Match a > > "word" character (alphanumeric plus "_") > > > > wow. thanks. that looks just like what i need. however, i also > want to match the _ charac

Re: dir delim and files with spaces

2001-06-12 Thread Hasanuddin Tamir
On Tue, 12 Jun 2001, me meagain <[EMAIL PROTECTED]> wrote, > I was wondering if anyone could tell me if there is a variable for > the directory delimiter... ie. "/" or "\". > > If not, what is the best way to go about figuring out which system > you are on and acting accordingly. I know about th

Re: Calling touch ...

2001-06-12 Thread Hasanuddin Tamir
On Tue, 12 Jun 2001, [EMAIL PROTECTED] > Here is the latest statements that I tried. > > system 'touch', 'test0612a.shtml'; system() returns 0 on success, other value on failure. What did you expect? If it fails to touch the file, is the path correct? Don't you need the full path to the file?

Re: Perl FAQ A Day

2001-06-11 Thread Hasanuddin Tamir
On Mon, 11 Jun 2001, Jeff Yoak <[EMAIL PROTECTED]> wrote, > Date: Mon, 11 Jun 2001 16:41:59 -0700 > From: Jeff Yoak <[EMAIL PROTECTED]> > To: Hasanuddin Tamir <[EMAIL PROTECTED]>, [EMAIL PROTECTED] > Subject: Re: Perl FAQ A Day > > At 01:58 AM 6/12/01 +0700

Re: Perl FAQ A Day

2001-06-11 Thread Hasanuddin Tamir
On Mon, 11 Jun 2001, Jeff Yoak <[EMAIL PROTECTED]> wrote, > Hi All, > > It occurred to me that some of you might be interested in a little mailing > list I maintain. It is broadcast only and mails a randomly selected > question / answer pair from the Perl FAQ each day to everyone on the >

Re: Changing unix/linux passwords with Perl?

2001-06-11 Thread Hasanuddin Tamir
On Fri, 8 Jun 2001, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote, > Hi Perl People, >I'm creating a web interface to a linux server and was wondering if >there are perl modules that can be used to change linux passwords? > > The idea is to be able to administrate a linux box witho

Re: if then else

2001-06-11 Thread Hasanuddin Tamir
On Fri, 8 Jun 2001, Jeff Yoak <[EMAIL PROTECTED]> wrote, > At 05:35 PM 6/8/01 -0400, Luinrandir Hernson wrote: > >ok, where did i go wrong now??? > > '=' is the assignment operator in Perl. '==' is the numeric comparison > operator and 'cmp' is the alpha which is what you want here. Ugly gotcha

Re: getopt @ARGV

2001-06-11 Thread Hasanuddin Tamir
On Fri, 8 Jun 2001, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote, > I am currently making an options menu front end to prevent user error. > Using getopt and @ARGV. The problem is that getopt yanks the first > argument... is there anyway to get it back? You can save the @ARGV array. @saved_argv

RE: Problems using hash.

2001-06-06 Thread Hasanuddin Tamir
t;; > #ok > > (*) If I type ...'$postInputs{ 'nombre'}, ... it works. I don't know > what is the problem. What are the content of $field[3] and $postInputs{$fields[3]}, or, do they have content at all? I don't know how you execute the sql syntax, but

Re: Substring retrieval

2001-06-05 Thread Hasanuddin Tamir
t there (among other functions as well), in your local documentation. If you prefer the web, www.perldoc.org to go. hth s.a.n -- Hasanuddin Tamir: [EMAIL PROTECTED] - Trabas: www.trabas.com

RE: one last attempt?

2001-06-05 Thread Hasanuddin Tamir
't need that for "#exec cmd". You can even do, provided that you have the right configuration. s.a.n -- Hasanuddin Tamir: [EMAIL PROTECTED] - Trabas: www.trabas.com

RE: one last attempt?

2001-06-05 Thread Hasanuddin Tamir
you can read a HOWTO about SSI in Apache site, http://httpd.apache.org/docs/howto/ssi.html hth s.a.n -- Hasanuddin Tamir: [EMAIL PROTECTED] - Trabas: www.trabas.com

Re: one last attempt?

2001-06-05 Thread Hasanuddin Tamir
> freaking answer on how to make this work?! The script is just fine. But for server side include to work there are other things you need. For Apache, you need to set "Options Includes" and set that your file is meant to be parsed as SSI page. And I'm not really comfortable to explain that in this list. s.a.n -- Hasanuddin Tamir: [EMAIL PROTECTED] - Trabas: www.trabas.com

Re: testing null strings for form field values

2001-06-05 Thread Hasanuddin Tamir
value at -e line 1. 1 >From the article (by Uri Guttman) in, http://tlc.perlarchive.com/articles/perl/ug0002.shtml "...autovivification happens when Perl automatically create a reference of the appropriate type when an undefined scalar value is dereferenced." I&#

Re: CGI-BIN

2001-06-05 Thread Hasanuddin Tamir
ch as, I can put wherever? Yes. I can even call your /cgi-bin/myscript.pl from my computer provided that I know the base URL :-) But it's not something you should worry about. s.a.n -- Hasanuddin Tamir: [EMAIL PROTECTED] - Trabas: www.trabas.com

Re: newcounter(was did i do that correctly)

2001-06-04 Thread Hasanuddin Tamir
scope by using a package name, $main::variable_name = 'some value'; use vars qw($variable_name); # another way to declare global variable * or in lexical scope by using my() operator as above, my $variable_name; hth s.a.n -- Hasanuddin Tamir: [EMAIL PROTECTED] - Trabas: www.trabas.com

Re: Substring retrieval

2001-06-04 Thread Hasanuddin Tamir
he substring you want to retrieve occur in the string? Exactly once? Can be more? - Are the start and end special characters just the same? Regular expression is the common way to solve this, but you could also use split() or combination of substr/index. __END__ s.a.n -- Hasanuddin Tamir: [EMAIL PROTECTED] - Trabas: www.trabas.com

Re: creating @array

2001-06-04 Thread Hasanuddin Tamir
p of your script. Oh, you don't actually need to loop over the lines and push them one by one just to get the whole content. You can assign them all directly. #!/usr/bin/perl -w use strict; open FILE, 'filename' or die "failed to open filename: $!\n"; m

Re: command line switches?

2001-06-04 Thread Hasanuddin Tamir
y want to have the switches listed, perl -h will do it for you. hth s.a.n -- Hasanuddin Tamir: [EMAIL PROTECTED] - Trabas: www.trabas.com

Re: Command Line Arguments and @_

2001-06-04 Thread Hasanuddin Tamir
ot; > > Typo. @ARGV is correct, as you already figured out. =o) > No, it's not a typo. It's a bad book (at least for the Perl part). s.a.n -- Hasanuddin Tamir: [EMAIL PROTECTED] - Trabas: www.trabas.com

Re: command line switches?

2001-06-04 Thread Hasanuddin Tamir
On Mon, 4 Jun 2001, David Gilden <[EMAIL PROTECTED]> wrote, > Which perldoc will list the command line switches? > Thanks perlvar s.a.n -- Hasanuddin Tamir: [EMAIL PROTECTED] - Trabas: www.trabas.com

Re: Redirecting after creating cookies - I can't!

2001-06-02 Thread Hasanuddin Tamir
t almost worked ­ but the url came out in CAPS so it wasn¹t recognised by > the browser. You want to put then together in the redirect(), print redirect( -uri => $gotourl, -cookie => [$clubid,$membername,$pointsbal], ); s.a.n -- Hasanuddin Tamir: [EMAIL PROTECTED] - Trabas: www.trabas.com

Re: Why 'and' not '&&' ? (was Cleaning up 'uninitialized value')

2001-05-31 Thread Hasanuddin Tamir
s something different than > > if ($a = func() && $b) { # assigns $a from (func() && $b) compare If func() returns false, $a set to it, otherwise $b. Perl doesn't only evaluate the truthness of the expression, but also returns the value of the last expression evaluated. s.a.n -- Hasanuddin Tamir: [EMAIL PROTECTED] - Trabas: www.trabas.com

Re: writing to a text file

2001-05-30 Thread Hasanuddin Tamir
;t seem to open it to write to. the file >does exist. here is the code for opening the file: > > if(! open(LOG, ">xxx.txt)) { >print "Content-type: text/html\n\n"; >print "Can't open xxx.txt\n"; >exit; > } If you put $! in the line

Re: installing perl

2001-05-30 Thread Hasanuddin Tamir
sorry this has nothing to do with the essence of your question. s.a.n -- Hasanuddin Tamir: [EMAIL PROTECTED] - Trabas: www.trabas.com

Re: Starting with perl...

2001-05-29 Thread Hasanuddin Tamir
ldoc perl from the command line. But if you prefer the web to find the resource, follow the other folks' advice. hth s.a.n -- Hasanuddin Tamir: [EMAIL PROTECTED] - Trabas: www.trabas.com

Re: reg ftp

2001-05-25 Thread Hasanuddin Tamir
e in unix format (no ^M) and then have a real ftp client that understands how to preserve that newline. But if your ftp client is so good that it can change the dos newline character sequence (^M aka LFCR aka \r\n) into unix style (LF aka \n) then you have nothing to worry about. hth s.a.n -- H