Re: easiest `cat` in perl

2003-10-02 Thread Bryan Harris
> use File::Copy; > copy "header.incl", \*STDOUT; I like this, it's very clean. Unfortunately I'm having trouble using it in a cgi script... ** #!/usr/bin/perl -w use File::Copy; print "Content-type: text/plain\n\n"; copy "header.incl", \*STDOUT; print "Mo

Validate String w/required period

2003-10-02 Thread perl
I'm trying to validate if a string contains \w and required atleas one period (.) This one check but does not require a period. Can someone change it please? sub isValidDomain { return shift =~ /^[\w\.]{3,}$/ } thanks, -rkl -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

RE: Testing Uninitialized Vars

2003-10-02 Thread TN
>if (defined $x and length $x) > >So, is this the opposite? > >if (! defined $x and ! length $x) I don't think so. It's basic Aristotelian logic and can be determined by truth tables or testing. Questions are mere conjecture :) The negative of a statement, A, is: not A. That can be writte

Re: Testing Uninitialized Vars

2003-10-02 Thread Steve Grazzini
On Thu, Oct 02, 2003 at 07:41:41PM -0700, [EMAIL PROTECTED] wrote: > unless understood, how about this. > > if (defined $x and length $x) > > So, is this the opposite? > > if (! defined $x and ! length $x) Nope; now you've got a boolean logic problem. Either of these would work, but unless() is

Re: Testing Uninitialized Vars

2003-10-02 Thread perl
unless understood, how about this. if (defined $x and length $x) So, is this the opposite? if (! defined $x and ! length $x) -rkl > On Thu, Oct 02, 2003 at 07:03:02PM -0700, [EMAIL PROTECTED] wrote: >> > if (defined $x and length $x) >> >> So, is this the opposite? >> >> if (! defined $x and

Re: Group list elements

2003-10-02 Thread John W. Krahn
"John W. Krahn" wrote: > > GöTz Verdieck wrote: > > > > I'm looking for a solution for the following problem: > > > > This is the list I have : $kommalist ="20,21,22,23,24,25,27,28,31,32,33"; > > > > And I want to convert it into : $newlist ="20..25,27,28,31..33"; > > > > So, I only want to combin

Re: Group list elements

2003-10-02 Thread John W. Krahn
GöTz Verdieck wrote: > > Hi, Hello, > I'm looking for a solution for the following problem: > > This is the list I have : $kommalist ="20,21,22,23,24,25,27,28,31,32,33"; > > And I want to convert it into : $newlist ="20..25,27,28,31..33"; > > So, I only want to combine the elements if there a

Re: Testing Uninitialized Vars

2003-10-02 Thread Steve Grazzini
On Thu, Oct 02, 2003 at 07:03:02PM -0700, [EMAIL PROTECTED] wrote: > > if (defined $x and length $x) > > So, is this the opposite? > > if (! defined $x and length $x) Nope; you've got a precedence problem. unless( defined $x and length $x ) { } -- Steve -- To unsubscribe, e-mail: [EMAIL

RE: Testing Uninitialized Vars

2003-10-02 Thread perl
> if (defined $x and length $x) So, is this the opposite? if (! defined $x and length $x) or do I have to parenthesis if (! (defined $x and length $x)) -rkl > On Oct 2, [EMAIL PROTECTED] said: > >>To recap, I want to test if a var is undefined or ''. >> >> if(undefined $x && length($x)==0) >

RE: Testing Uninitialized Vars

2003-10-02 Thread Jeff 'japhy' Pinyan
On Oct 2, [EMAIL PROTECTED] said: >To recap, I want to test if a var is undefined or ''. > > if(undefined $x && length($x)==0) There IS no 'undefined' function in Perl, and you don't want to use &&, you'd want to use ||, since the empty string "" IS defined. if (not defined($x) or length($x) =

RE: Testing Uninitialized Vars

2003-10-02 Thread perl
James has my intention correctly: my $x=0; if($x) #this would return false which is NOT I was looking for. To recap, I want to test if a var is undefined or ''. Thus, this would be equivalent to my isNULL() approach? if(undefined $x && length($x)==0) thanks, -rkl >> -Original Message---

Re: Testing Uninitialized Vars

2003-10-02 Thread James Edward Gray II
On Thursday, October 2, 2003, at 07:23 PM, LoBue, Mark wrote: -Original Message- From: James Edward Gray II [mailto:[EMAIL PROTECTED] Sent: Thursday, October 02, 2003 5:20 PM To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Subject: Re: Testing Uninitialized Vars On Thursday, October 2, 2003,

RE: Testing Uninitialized Vars

2003-10-02 Thread LoBue, Mark
> -Original Message- > From: James Edward Gray II [mailto:[EMAIL PROTECTED] > Sent: Thursday, October 02, 2003 5:20 PM > To: [EMAIL PROTECTED] > Cc: [EMAIL PROTECTED] > Subject: Re: Testing Uninitialized Vars > > > On Thursday, October 2, 2003, at 07:08 PM, [EMAIL PROTECTED] wrote: > >

Re: Testing Uninitialized Vars

2003-10-02 Thread James Edward Gray II
On Thursday, October 2, 2003, at 07:08 PM, [EMAIL PROTECTED] wrote: you mean $x=0; would be false? Yep. James -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Testing Uninitialized Vars

2003-10-02 Thread perl
you mean $x=0; would be false? > On Thursday, October 2, 2003, at 06:29 PM, [EMAIL PROTECTED] wrote: > >> Are you saying this would do everything that I want? >> >> #I'm considering undefined var and '' and 0s are the same thing. >> if($x) ... true - do_something > > I said it would, if you don't

Re: Testing Uninitialized Vars

2003-10-02 Thread James Edward Gray II
On Thursday, October 2, 2003, at 06:29 PM, [EMAIL PROTECTED] wrote: Are you saying this would do everything that I want? #I'm considering undefined var and '' and 0s are the same thing. if($x) ... true - do_something I said it would, if you don't mind 0 being false. James -- To unsubscribe, e-

Re: Testing Uninitialized Vars

2003-10-02 Thread perl
Are you saying this would do everything that I want? #I'm considering undefined var and '' and 0s are the same thing. if($x) ... true - do_something -rkl > On Thursday, October 2, 2003, at 05:09 PM, [EMAIL PROTECTED] wrote: > >>> if ( ! defined $x ) >> >> I read up on defined and undefined. But

RE: explicit vs implicit syntax

2003-10-02 Thread perl
All this is in the same paragraph of oreilly Programming perl page 100 - pub in 1991. I guess it is kinda old. Anyway, it actually says "...more efficient..." But I'm still sticking with showarg(); style too. -rkl >> But Orielly says showargs() is slower than showargs > > That's a good point, an

Re: Testing Uninitialized Vars

2003-10-02 Thread James Edward Gray II
On Thursday, October 2, 2003, at 05:09 PM, [EMAIL PROTECTED] wrote: if ( ! defined $x ) I read up on defined and undefined. But I'm looking for a test that will this return true or false to a var condition: perldoc -f defined perldoc -f undef The second is a little different than what you thin

RE: Why is unlinking a directory bad or worse then rmdir

2003-10-02 Thread TN
Using unlink may do what you want...and more in terms of unexpected side effects later on that could have dire consequences. For that reason on most Unix systems the use of unlink (and unlink()) requires root access and the use of rmdir (and rmdir()) is strongly encouraged because it permits only

RE: explicit vs implicit syntax

2003-10-02 Thread Hanson, Rob
> But Orielly says showargs() is slower than showargs That's a good point, and something I didn't know. ...I'm not sure if it will make me change my ways though. Do you know where you read that? I'm not sure why it would be slower, I would think that this would be optimized when the code is com

RE: explicit vs implicit syntax

2003-10-02 Thread perl
I agree it looks like the best standardized candidate for use. But Orielly says showargs() is slower than showargs when not passing arguments. It's just a minor point but its something I read. In any case, I'm used to the showarg() style. thanks, -rkl >> showargs(); > > I like this one. It's th

Re: Testing Uninitialized Vars

2003-10-02 Thread perl
> if ( ! defined $x ) I read up on defined and undefined. But I'm looking for a test that will this return true or false to a var condition: ... sub isNULL { return undefined $_[0] && $_[0] eq '' $_[0] eq ""; } # my goal is all three return the same as # my proposed sub isNULL() my $x;

Re: How do I RegExp Match a ? without using \X{3F}?

2003-10-02 Thread James Edward Gray II
On Thursday, October 2, 2003, at 04:54 PM, Dan Anderson wrote: Is there a way to match a question mark using a regular expression without looking for a \X{3F} ? ~> perl -e 'print "Matched a ?\n" if "A question?" =~ /\?/' Matched a ? James -- To unsubscribe, e-mail: [EMAIL PROTECTED] For addition

Re: How do I RegExp Match a ? without using \X{3F}?

2003-10-02 Thread Daniel Staal
--On Thursday, October 2, 2003 17:54 -0400 Dan Anderson <[EMAIL PROTECTED]> wrote: Is there a way to match a question mark using a regular expression without looking for a \X{3F} ? Just escape it: \? Daniel T. Staal --- This email copy

RE: problem with date routine THANKS!!

2003-10-02 Thread perlwannabe
Thank you for all of the responses to my date/time problem. I have rewritten the routine with the information and feel confident it is far, far better than what I had. Thanks... -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

How do I RegExp Match a ? without using \X{3F}?

2003-10-02 Thread Dan Anderson
Is there a way to match a question mark using a regular expression without looking for a \X{3F} ? Thanks in advance, -Dan -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

RE: explicit vs implicit syntax

2003-10-02 Thread Hanson, Rob
My preference... > &showargs(); Ick. I use this one when it is required (references and overriding prototypes), otherwise it isn't what I mean. If I mean to just execute the method, then I don't use it. > showargs; Yuk. It saves a few keystrokes, but I tend to avoid it. > showargs(); I lik

Re: using 3 arrays

2003-10-02 Thread Daniel Staal
--On Thursday, October 2, 2003 14:31 -0700 A L <[EMAIL PROTECTED]> wrote: @1@2@3 item1aitem1bitem1c item2aitem2bitem2c . . . . . . . . . They all have an equal number of items. I

RE: using 3 arrays

2003-10-02 Thread Wagner, David --- Senior Programmer Analyst --- WGO
A L wrote: > Thanks for helping me on my previous question; I was able to get it > afterwards. I have another question. First, I have 3 arrays and > wanted to print out the items of corresponding places in a > sequential order. I have tried using foreach function, like >below forea

Re: using 3 arrays

2003-10-02 Thread James Edward Gray II
On Thursday, October 2, 2003, at 04:31 PM, A L wrote: Thanks for helping me on my previous question; I was able to get it afterwards. I have another question. First, I have 3 arrays and wanted to print out the items of corresponding places in a sequential order. I have tried using foreach f

RE: explicit vs implicit syntax

2003-10-02 Thread perl
Thanks I understand what you're saying. If I could ask, which one of these would you use? > &showargs; #NOT this is the tricky > &showargs(); > showargs; > showargs(); thanks, -rkl > [EMAIL PROTECTED] asked: >> Here's an excerpt about the & from orielly and what the heck >> does it means: >>

RE: explain regex statement?

2003-10-02 Thread Hanson, Rob
Close, not quite. The "quantifier" (i.e. ?,+,*) appear AFTER the "atom" (i.e. char or special symbol). The syntax is also off a bit. It should be =~ and /../ (not single ticks). $result =~ /^ *-?[0-9]+[.]?[0-9]* *\$/; ^ = beginning of line (also called an anchor) * = zero or more spaces (no

using 3 arrays

2003-10-02 Thread A L
Thanks for helping me on my previous question; I was able to get it afterwards. I have another question. First, I have 3 arrays and wanted to print out the items of corresponding places in a sequential order. I have tried using foreach function, like below foreach $a (@1){ foreach$b (@2){

Re: Testing Uninitialized Vars

2003-10-02 Thread James Edward Gray II
On Thursday, October 2, 2003, at 04:25 PM, [EMAIL PROTECTED] wrote: I wan to write a sub return true or false if the var was initialized. We can do that, but I really don't think we need a sub for it, since there is a built-in. Can someone correct this sub or is it good? No, I wouldn't call it

Testing Uninitialized Vars

2003-10-02 Thread perl
I wan to write a sub return true or false if the var was initialized. Can someone correct this sub or is it good? ... if(isNULL($x) { print "it is null\n"); else { print "it is NOT null\n"); ... sub isNULL { return $_[0] =~ // } thanks, -rkl -- To unsubscribe, e-mail: [EMAIL PR

Excel to HTML

2003-10-02 Thread Shelly B.
I am using Perl's Spreadsheet Module to write a nicely formatted Report. Now the customer want to convert it into "HTML" format, keeping the same formatting. I was wondering if there is a module or something which will convert the original Excel Spreadsheet and convert into HTML. I know

explain regex statement?

2003-10-02 Thread Johnson, Shaunn
Howdy: I have a statement and I'm trying to see if I understand what it is really is doing (not my code). The code does this: [snip] result ~ '^ *-?[0-9]+[.]?[0-9]* *\$' [/snip] I break out the meaning as this: [snip example] ^ = beginning of line plus a white space *- = everything up to,

RE: owner's name of a file

2003-10-02 Thread TN
Suggest also that you talk with your network and novell admins to find out how authentication is mapped from the novell server to the win2k server. Based on my experience with nfs and samba that could result in the loss of visibility of novell file ownership - for example on an nfs share all file

Re: Group list elements

2003-10-02 Thread david
GöTz Verdieck wrote: > Hi, > I'm looking for a solution for the following problem: > > This is the list I have : $kommalist ="20,21,22,23,24,25,27,28,31,32,33"; > > And I want to convert it into : $newlist ="20..25,27,28,31..33"; > > So, I only want to combine the elements if there are more tha

Re: owner's name of a file

2003-10-02 Thread R. Joseph Newton
Josimar Nunes de Oliveira wrote: > Hi Michel, > > Thanks for your help, but the code will run on windows2000server and the > mapped drive points to a folder on novell server. > The "getpwuid" is unimplemented in windows2000server perl. > I would like to take the file´s ownership related to novell

RE: problem with date routine

2003-10-02 Thread LoBue, Mark
> -Original Message- > From: Charles K. Clarkson [mailto:[EMAIL PROTECTED] > Sent: Thursday, October 02, 2003 4:42 AM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > Subject: RE: problem with date routine > > > perlwannabe <[EMAIL PROTECTED]> wrote: > : > : I have a relatively simple script

Re: Perl Beginners Portals

2003-10-02 Thread Shlomi Fish
On Thu, 2 Oct 2003, Todd Wade wrote: > > "R. Joseph Newton" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] > > Todd Wade wrote: > > > > > I'm willing to pester the site owners to let you do the site. But it > will > > > probably take more than just you and I. The lack of responses t

Re: easiest `cat` in perl

2003-10-02 Thread Steve Grazzini
On Thu, Oct 02, 2003 at 05:17:34PM +0200, Thomas B?tzler wrote: > Todd Wade <[EMAIL PROTECTED]> wrote: > > "Gary Stainburn" <[EMAIL PROTECTED]> wrote in message > > news:[EMAIL PROTECTED] > > > print while(); > > This is bad because it first pulls in the file to > build the list. It doesn't. The

RE: easiest `cat` in perl

2003-10-02 Thread Thomas Bätzler
Joshua Colson [mailto:[EMAIL PROTECTED] suggested: > sub load_file { > my($file,$html) = shift; > $html = ''; > open(FILE, "$file") or die "Cannot open $file for reading: $!" > while() { $html .= $_; } > return $html; > } Instead of "while() { $html .= $_; }", you could use "$html = join

RE: easiest `cat` in perl

2003-10-02 Thread Thomas Bätzler
Todd Wade <[EMAIL PROTECTED]> wrote: > "Gary Stainburn" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] [...] > > One thing you forgot was to close the file. Also, don't > > forget that you can do it with less typing: Closing files is optional in Perl ;-) Filehandles will either b

Re: easiest `cat` in perl

2003-10-02 Thread Randal L. Schwartz
> "Bryan" == Bryan Harris <[EMAIL PROTECTED]> writes: Bryan> What I'm interested in is what's the easiest way to print the Bryan> contents of a file? For example, if I want to output my header Bryan> file, "header.incl", how can I print the contents of that file Bryan> the easiest (and most g

RE: Redirect perldoc to usb printer

2003-10-02 Thread Bob Showalter
Paul Kraus wrote: > Not running cygwin. > > This works but still requires I redirect to a text file first. > > I want to be able to pipe. > > Perldoc -f localtime | command > Then have it just dump to the usb printer. This should work (assuming ActiveState) C:\> perl c:\perl\bin\perldoc.bat

Re: easiest `cat` in perl

2003-10-02 Thread Joshua Colson
# Set $header_file to the PATH to header.incl my $header_file = 'header.incl'; # Call load_file() which takes a filename as an argument and # returns the contents of that file. Then print what load_file() # returns. print load_file($header_file); sub load_file { my($file,$html) = shift; $html

RE: Redirect perldoc to usb printer

2003-10-02 Thread Paul Kraus
Not running cygwin. This works but still requires I redirect to a text file first. I want to be able to pipe. Perldoc -f localtime | command Then have it just dump to the usb printer. -Original Message- From: TN [mailto:[EMAIL PROTECTED] Sent: Thursday, October 02, 2003 10:28 AM To:

Re: Perl Beginners Portals

2003-10-02 Thread Todd Wade
"R. Joseph Newton" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Todd Wade wrote: > > > I'm willing to pester the site owners to let you do the site. But it will > > probably take more than just you and I. The lack of responses to your OP > > might indicate the amount of help the r

RE: Get email adress from AD or exchange?

2003-10-02 Thread Dan Muey
> Has anyone done this in Perl, is there an module that can > help me? I am aware of that I can use the Win32::Ole, but > what I really want is an more easier way of asking: use Mail::Internet; my $mail = Mail::Internet->new(\*STDIN); # see docs on how to use an array instead of a file handle

Re: easiest `cat` in perl

2003-10-02 Thread Peter Scott
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] (Todd Wade) writes: > >"Gary Stainburn" <[EMAIL PROTECTED]> wrote in message >news:[EMAIL PROTECTED] >> On Thursday 02 Oct 2003 10:25 am, Owen wrote: >> > On Wed, 01 Oct 2003 23:14:00 -0700 >> > >> > Bryan Harris <[EMAIL PROTECTED]> wrote: >> > > W

RE: Perl and cron

2003-10-02 Thread TN
Hi, I'm confused by the listing of your crontab. Anyway, script A seems to be working ok. The problem seems to be with script B. But is this true? The snoop manpage (for Solaris 8, see http://docs.sun.com/db/doc/806-0625/6j9vfim06?q=snoop&a=view) says that "snoop requires an interactive interfa

RE: uploadfiles

2003-10-02 Thread Dan Muey
> Hi, Howdy > I'm trying to write a CGI script to upload a file from a > > #!/usr/bin/perl -w > use strict; > use CGI qw/:standard/ > print "Content-type: text/html\n\n"; > > print $query->filefield('uploaded_file'); > $filename = $query->param('uploaded_file'); > $fh = $query->upload('u

RE: Redirect perldoc to usb printer

2003-10-02 Thread TN
To print from cygwin avoiding the DOS window try: cmd /c "start /min notepad /P " This will print to the default printer which can be a USB printer. does not need a .txt suffix. -tristram -Original Message- From: TN [mailto:[EMAIL PROTECTED] Sent: Thursday, October 02, 2003 9:45 AM T

Re: easiest `cat` in perl

2003-10-02 Thread Todd Wade
"Gary Stainburn" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > On Thursday 02 Oct 2003 10:25 am, Owen wrote: > > On Wed, 01 Oct 2003 23:14:00 -0700 > > > > Bryan Harris <[EMAIL PROTECTED]> wrote: > > > What I'm interested in is what's the easiest way to print the contents of > > >

Perl and cron

2003-10-02 Thread rmck
Hi and Help, I have a perl script (A) that spawns a unix command and pipes that to a log file. Then at 23:59 I have a perl script (B) that kills script (A). At midnight script (A) is kicked off. My issue is my killing of srcipt (A) is not working. It either is showing under ps, but not doing

RE: Redirect perldoc to usb printer

2003-10-02 Thread TN
In DOS you can run start /min notepad /P I've tested it and it works. This will print a text file even without having a .txt suffix With my cygwin setup notepad /P Works but a DOS window flashes for a split second before printing. Not sure where the DOS start command is, but by putting th

Re: Getting started in Perl for OSX

2003-10-02 Thread R. Joseph Newton
James Edward Gray II wrote: > On Wednesday, October 1, 2003, at 04:34 PM, McMahon, Chris wrote: > > > But Perl doesn't come with OSX by default. You may or may not have > > an install CD called "Developer Tools" or some such, and Perl is on > > that. > > At the risk of sounding like a brok

RE: perl -v produces different output each time

2003-10-02 Thread TN
Hi, I would not try to understand the problem too much, but instead just get rid of it and improve the perl environment on your server. To do this I suggest that you upgrade to a late version of perl. You can get sources for 5.8.1 from http://www.perl.com/pub/a/language/info/software.html and bu

OT: Redirect perldoc to usb printer

2003-10-02 Thread Paul Kraus
Kind of off topic. How can you redirect to a usb printer from the shell in windows xp? Its getting really irritating having to perldoc -f function > function.txt Open function.txt in notepad and then print. Thanks, Paul -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-

perl -v produces different output each time

2003-10-02 Thread Halkyard, Jim
Hi all, May I start by thanking all the people who have helped me in the past, and I hope you can help me with this one. I have a Solaris 5.8 server with a version of Perl provided as part of Rational ClearCase, and I am getting very strange errors. Sometimes scripts fail when use'ing Getopt::L

RE: problem with date routine

2003-10-02 Thread Charles K. Clarkson
perlwannabe <[EMAIL PROTECTED]> wrote: : : I have a relatively simple script that needs to get : two separate dates, today's date, and yesterday's : date. The dates are in mmddyy format. : Here is the script: : : : ## BEGIN SCRIPT : my ($mday,

Re: explicit vs implicit syntax

2003-10-02 Thread Chuck Fox
In other words - save it for Perl Golf ;-) HTH, Thomas PS: Perl Golf - writing code with as little (key-)strokes as possible. Thomas, Beyond all the enlightenment that this list brings, I am stunned (ROTFLMAO) to realize that coding could be a sport. Cya at the 19th hole. Chuck -- To u

RE: explicit vs implicit syntax

2003-10-02 Thread Thomas Bätzler
[EMAIL PROTECTED] asked: > Here's an excerpt about the & from orielly and what the heck > does it means: > > "...If a subroutine is called using the & form, the argument list is > optional. if ommitted, no @_ array is setup for the routine; > the @_ array at the time of the call is visible to su

Re: easiest `cat` in perl

2003-10-02 Thread Gary Stainburn
On Thursday 02 Oct 2003 10:25 am, Owen wrote: > On Wed, 01 Oct 2003 23:14:00 -0700 > > Bryan Harris <[EMAIL PROTECTED]> wrote: > > What I'm interested in is what's the easiest way to print the contents of > > a file? For example, if I want to output my header file, "header.incl", > > how can I pri

Re: explicit vs implicit syntax

2003-10-02 Thread John W. Krahn
[EMAIL PROTECTED] wrote: > > Here's an excerpt about the & from orielly and what the heck does it means: > > "...If a subroutine is called using the & form, the argument list is > optional. if ommitted, no @_ array is setup for the routine; the @_ array > at the time of the call is visible to sub

Re: easiest `cat` in perl

2003-10-02 Thread Owen
On Wed, 01 Oct 2003 23:14:00 -0700 Bryan Harris <[EMAIL PROTECTED]> wrote: > > What I'm interested in is what's the easiest way to print the contents of a > file? For example, if I want to output my header file, "header.incl", how > can I print the contents of that file the easiest (and most gen

Group list elements

2003-10-02 Thread Götz Verdieck
Hi, I'm looking for a solution for the following problem: This is the list I have : $kommalist ="20,21,22,23,24,25,27,28,31,32,33"; And I want to convert it into : $newlist ="20..25,27,28,31..33"; So, I only want to combine the elements if there are more than two like 20,21,23 Any hint or code

Re: problem with date routine

2003-10-02 Thread John W. Krahn
Perlwannabe wrote: > > I have a relatively simple script that needs to get two separate dates, > today's date, and yesterday's date. The dates are in mmddyy format. > Everything works great on days 2 - 31 of the month, but on the first of > the month yesterday's date is not correct. For example,

Re: invoking sub/methods shortcut

2003-10-02 Thread Jason E. Stewart
"John W. Krahn" <[EMAIL PROTECTED]> writes: > [EMAIL PROTECTED] wrote: > > > > Can I do something like this? > > from > > $sth = getVUser($dbh, $u, $d); > > return $sth->rows(); > > to > > return (getVUser($dbh,$u,$d))->rows(); I find this more readable return getVUser($dbh,$u,$d)->rows();

RE: explicit vs implicit syntax

2003-10-02 Thread perl
Here's an excerpt about the & from orielly and what the heck does it means: "...If a subroutine is called using the & form, the argument list is optional. if ommitted, no @_ array is setup for the routine; the @_ array at the time of the call is visible to subroutine instead." So, is there a bett

RE: explicit vs implicit syntax

2003-10-02 Thread Tim Johnson
Generally the use of the ampersand in subroutine calling is considered a bad habit even though it will work for most subs. For one thing, a sub called with the ampersand ignores any subroutine prototyping. As far as the parentheses go, I always use them even if there is nothing being passed beca

explicit vs implicit syntax

2003-10-02 Thread perl
Is it really bad practice oneway or another with calling sub? &doMe; &doMe(); doMe; doMe(); Please explain in terms of performance and practice. thanks, -rkl -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: invoking sub/methods shortcut

2003-10-02 Thread perl
both of these works: >> return (getVUser($dbh,$u,$d))->rows(); and return getVUser($dbh,$u,$d)->rows(); -rkl > [EMAIL PROTECTED] wrote: >> >> Can I do something like this? >> from >> $sth = getVUser($dbh, $u, $d); >> return $sth->rows(); >> to >> return (getVUser($dbh,$u,$d))->rows(); >

Re: invoking sub/methods shortcut

2003-10-02 Thread John W. Krahn
[EMAIL PROTECTED] wrote: > > Can I do something like this? > from > $sth = getVUser($dbh, $u, $d); > return $sth->rows(); > to > return (getVUser($dbh,$u,$d))->rows(); What happened when you tried it? John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For a