[19465] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 1660 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 30 18:05:43 2001

Date: Thu, 30 Aug 2001 15:05:13 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <999209113-v10-i1660@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 30 Aug 2001     Volume: 10 Number: 1660

Today's topics:
    Re: a mystery to me: EOF <krahnj@acm.org>
    Re: a mystery to me: EOF <krahnj@acm.org>
    Re: Calling sub funcs with scalar variables? (Yves Orton)
        can this perl script be more elegant/shorter ? (Tim)
    Re: combining varibles (Clay Irving)
    Re: combining varibles <cberry@cinenet.net>
    Re: Comparing two dates! Is there an easy way? (Chris Fedde)
    Re: Comparing two dates! Is there an easy way? <comdog@panix.com>
    Re: Comparing two dates! Is there an easy way? <godzilla@stomp.stomp.tokyo>
    Re: Comparing two dates! Is there an easy way? <vmurphy@Cisco.Com>
    Re: DBI connect string for Sybase Anywhere Studio (Upda (gnari)
        Deleting files? <nathan.randle@ntlworld.com>
    Re: Deleting files? (John J. Trammell)
    Re: Deleting files? <nathan.randle@ntlworld.com>
    Re: Deleting files? (John J. Trammell)
    Re: Difference between .pl, .cgi, and .pm File Extensio <comdog@panix.com>
    Re: Extracting data from emails (Clay Irving)
    Re: FAQ asking (was Re: CODE reference to member functi (Yves Orton)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Thu, 30 Aug 2001 20:16:32 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: a mystery to me: EOF
Message-Id: <3B8E9F95.72123D38@acm.org>

Villy Kruse wrote:
> 
> On 30 Aug 2001 05:39:58 -0700,
>     Joachim Ziegler <ziegler@algorilla.de> wrote:
> 
> >(btw, how do i generate this character by a keyboard-stroke under
> >Windows?)
> 
> MS-DOS uses ctrl-Z for the same purpose.   For historical reasons and
> compatibility with CP/M this works also in disk files.
> 
> >i can't find it in my ASCII-table, because it does not show the
> >non-printable characters. can someone please point me to a complete table?
> >
> >i'm conjecturing the following:
> >
> >the EOF-character is *not* the last character of any file, right?
> 
> There is no such thing as an EOF character.

Actually, C/PM used the Ctrl-Z character to mark the end of file because
the C/PM file system didn't store the file size just the number of
"blocks" that the file used.



John
-- 
use Perl;
program
fulfillment


------------------------------

Date: Thu, 30 Aug 2001 20:21:58 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: a mystery to me: EOF
Message-Id: <3B8EA0DB.A2E09D53@acm.org>

Joachim Ziegler wrote:
> 
> i can't find it in my ASCII-table, because it does not show the
> non-printable characters. can someone please point me to a complete table?

http://www.mindspring.com/~jc1/serial/Resources/ASCII.html



John
-- 
use Perl;
program
fulfillment


------------------------------

Date: 30 Aug 2001 11:17:17 -0700
From: demerphq@hotmail.com (Yves Orton)
Subject: Re: Calling sub funcs with scalar variables?
Message-Id: <74f348f7.0108301017.51ab7df1@posting.google.com>

tadmc@augustmail.com (Tad McClellan) wrote in message news:<slrn9osbdd.79c.tadmc@tadmc26.august.net>...
> Yves Orton <demerphq@hotmail.com> wrote:
> >tadmc@augustmail.com (Tad McClellan) wrote in message news:<slrn9or6di.5ak.tadmc@tadmc26.august.net>...
> >> GunneR <ds@ss.com> wrote:
> >> >I want the following to execute a sub function:
> >> >
> >> >&"$func"; ## Of course this doesnt work... its just to give you an
> >> >idea.
> >> >
> >> >Ive tried &($func); &{$func} and the like but no go. Im sure theres a
>  
> >> What you are asking for is called "Symbolic references". They are bad:
> 
> 
> >Well.  Im not going to argue they arent a good idea, and shouldn't be
> >used in general but really 'They are bad' is a little to absolute and
> >simple for me.
>         ^^^^^^
> 
> 
> But I wasn't following up to you :-)
> 
> I adjusted for the perceived knowledge level of my audience.
> 
> For people that kind of dance around the idea of symrefs, "they are bad"
> is all they need to know. When they know enough to recognize that it
> is not universally applicable, then they know enough to contemplate
> actually using symrefs.
> 
> You are not ready to use symrefs unless you already know why
> they are bad.

Heh. Exactly. Funny, I almost said on the next line "But then you
didnt reply to me.." or the like, but i couldnt word it right and left
it out. :-)

I very much agree with your last sentence there, and basically that is
the reason I said anything at all.  I think it might have encouraged
the OP to read the appropriate docs to understand why they are bad,
instead of just telling them it is bad, cause then they might decide
'Well its bad, no sense in figuring out how it works' (assuming they
arent the ornery type :-)

> Perl maintains function (and scalars, arrays, etc...) names in
> a hash (the Symbol Table). When this hash is accessed is controlled
> by perl (in response to using a symref, for example).
> 
> You can maintain the same information in your very own hash, and
> then you don't need to know how Perl uses/accesses the symbol table.
> 
> Plain hash accesses are harder to trick than symbol table accesses.

Yes true.  I have even written a tied hash that can remember every
lookup that has been done, so I track down some of the odder hash
error scenarios.

Anyway, do you mind if I use your line a signature, I think its pretty
good?
Yves


------------------------------

Date: 30 Aug 2001 14:41:53 -0700
From: tvn007@hotmail.com (Tim)
Subject: can this perl script be more elegant/shorter ?
Message-Id: <21724be2.0108301341.149624c1@posting.google.com>

Hi,

Could some one help me to make this script more elegant and shorter ?

Here is my PERL script:

#!/usr/local/bin/perl5 -w

$input1 = 'chaintest.scan';
$output= "OUT";
$output2= "OUT.out";

open (INFILE,"$input1")||die "cannot open $input1";
open(OUTFILE,">$output")||die "canoot\n";
open(OUTFILE2,">$output2")||die "canoot\n";

#######################################################
        &preprocess;
open (INFILE2,"$output")||die "cannot open $input1";
        $/=";";
        $ct_scanout = 0;
        while (<INFILE2>){
        chomp;
        $ct_scanout = 1 if (/apply\s*\"grp[0-9]_unload\"/);
        $chain_test=1  if (/CHAIN_TEST/);

if (( /\t*chain\s+\"chain([0-9])\"/) && ($chain_test)){
                $chain_number = $1;
                &cleanup;
                        $chain_input = (split /=/,$_)[1];
                        $chain_input =~ tr/\"//d;
                SWITCH: {
                                $chain_number==1 && do {
                                @chain1 = split (//,$chain_input);
                                $scan_chain_length1 = @chain1; };
                                $chain_number==2 && do {
                                @chain2 = split (//,$chain_input);
                                $scan_chain_length2 = @chain2; };
                                $chain_number==3 && do {
                                @chain3 = split (//,$chain_input);
                                $scan_chain_length3 = @chain3; };
                                $chain_number==4 && do {
                                @chain4 = split (//,$chain_input);
                                $scan_chain_length4 = @chain4; };
                                $chain_number==5 && do {
                                @chain5 = split (//,$chain_input);
                                $scan_chain_length5 = @chain5; };
                                $chain_number==6 && do {
                                @chain6 = split (//,$chain_input);
                                $scan_chain_length6 = @chain6; };
                                $chain_number==7 && do {
                                @chain7 = split (//,$chain_input);
                                $scan_chain_length7 = @chain7;
                                &printout;
                                };
                }#END SWITCH
        }
} #end of While statement
sub printout {
        if ($ct_scanout ){
                        for ($i=0;$i<$scan_chain_length3;$i++){
               $chain1[$i] =~ s/0/L/g; $chain1[$i] =~ s/1/H/g;
               $chain2[$i] =~ s/0/L/g; $chain2[$i] =~ s/1/H/g;
               $chain3[$i] =~ s/0/L/g; $chain3[$i] =~ s/1/H/g;
               $chain4[$i] =~ s/0/L/g; $chain4[$i] =~ s/1/H/g;
               $chain5[$i] =~ s/0/L/g; $chain5[$i] =~ s/1/H/g;
               $chain6[$i] =~ s/0/L/g; $chain6[$i] =~ s/1/H/g;
               $chain7[$i] =~ s/0/L/g; $chain7[$i] =~ s/1/H/g;
                print OUTFILE2 "\n(ct_so
$chain1[$i]$chain2[$i]$chain3[$i]$chain4[$i]$chain5[$i]$chain6[$i]$chain7[$i]
 )";
                                        }
                $ct_scanout=0;
        }
        elsif ($ct_scanout==0){
                        for ($i=0;$i<$scan_chain_length3;$i++){
                $chain1[$i] =~ s/X/0/g; $chain2[$i] =~ s/X/0/g;
                $chain3[$i] =~ s/X/0/g; $chain4[$i] =~ s/X/0/g;
                $chain5[$i] =~ s/X/0/g; $chain6[$i] =~ s/X/0/g;
                $chain7[$i] =~ s/X/0/g;
                        print OUTFILE2 "\n(ct_si  $ct_si{tdi}
$chain1[$i]$chain2[$i]$chain3[$i]$chain4[$i]$chain5[$i]$chain6[$i]$chain7[$i]
 )";
                                        }
        }
}
sub cleanup{
                  s/^\s+|\s*\n+$//g;
                  tr/\t  //d;            
                  s/\n//g;                
                  s/\\//g;
}
sub preprocess{
        while (<INFILE>){
                chomp;
        s/$/;/g if (/apply/);
        print OUTFILE ("$_\n");
        last if ( /^SCAN_CELLS/);
        }
        close OUTFILE;
}

#below is the input file (chaintest.scan) for the script above:

CHAIN_TEST =

    pattern = 0;
    apply "grp1_load" 0 =;
        chain "chain1" =
"00110011001100110011001100110011001100110011001100\
                     
11001100110011001100110011001100110011001100110011\
                     
00110011001100110011001100110011001100110011001100\
                     
11001100110011001100110011001100110011001100110011\
                     
00110011001100110011001100110011001100110011001100\
                     
11001100110011001100110011001100110011001100110011\
                     
00110011001100110011001100110011001100110011001100\
                     
11001100110011001100110011001100110011001100110011\
                     
00110011001100110011001100110011001100110011001100\
                      1100110011001100110011001100110011001100110";
        chain "chain2" =
"X0011001100110011001100110011001100110011001100110\
                     
01100110011001100110011001100110011001100110011001\
                     
10011001100110011001100110011001100110011001100110\
                     
01100110011001100110011001100110011001100110011001\
                     
10011001100110011001100110011001100110011001100110\
                     
01100110011001100110011001100110011001100110011001\
                     
10011001100110011001100110011001100110011001100110\
                     
01100110011001100110011001100110011001100110011001\
                     
10011001100110011001100110011001100110011001100110\
                      0110011001100110011001100110011001100110011";
        chain "chain3" =
"X0011001100110011001100110011001100110011001100110\
                     
01100110011001100110011001100110011001100110011001\
                     
10011001100110011001100110011001100110011001100110\
                     
01100110011001100110011001100110011001100110011001\
                     
10011001100110011001100110011001100110011001100110\
                     
01100110011001100110011001100110011001100110011001\
                     
10011001100110011001100110011001100110011001100110\
                     
01100110011001100110011001100110011001100110011001\
                     
10011001100110011001100110011001100110011001100110\
                      0110011001100110011001100110011001100110011";
        chain "chain4" =
"X0011001100110011001100110011001100110011001100110\
                     
01100110011001100110011001100110011001100110011001\
                     
10011001100110011001100110011001100110011001100110\
                     
01100110011001100110011001100110011001100110011001\
                     
10011001100110011001100110011001100110011001100110\
                     
01100110011001100110011001100110011001100110011001\
                     
10011001100110011001100110011001100110011001100110\
                     
01100110011001100110011001100110011001100110011001\
                     
10011001100110011001100110011001100110011001100110\
                      0110011001100110011001100110011001100110011";
 chain "chain5" = "X0011001100110011001100110011001100110011001100110\
                     
01100110011001100110011001100110011001100110011001\
                     
10011001100110011001100110011001100110011001100110\
                     
01100110011001100110011001100110011001100110011001\
                     
10011001100110011001100110011001100110011001100110\
                     
01100110011001100110011001100110011001100110011001\
                     
10011001100110011001100110011001100110011001100110\
                     
01100110011001100110011001100110011001100110011001\
                     
10011001100110011001100110011001100110011001100110\
                      0110011001100110011001100110011001100110011";
        chain "chain6" =
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\
                     
XXXXXXXXXXXX00110011001100110011001100110011001100\
                     
11001100110011001100110011001100110011001100110011\
                     
00110011001100110011001100110011001100110011001100\
                     
11001100110011001100110011001100110011001100110011\
                     
00110011001100110011001100110011001100110011001100\
                     
11001100110011001100110011001100110011001100110011\
                     
00110011001100110011001100110011001100110011001100\
                     
11001100110011001100110011001100110011001100110011\
                      0011001100110011001100110011001100110011001";
        chain "chain7" =
"XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX\
                     
XXXXXXXXXXXXX0011001100110011001100110011001100110\
                     
01100110011001100110011001100110011001100110011001\
                     
10011001100110011001100110011001100110011001100110\
                     
01100110011001100110011001100110011001100110011001\
                     
10011001100110011001100110011001100110011001100110\
                     
01100110011001100110011001100110011001100110011001\
                     
10011001100110011001100110011001100110011001100110\
                     
01100110011001100110011001100110011001100110011001\
                      1001100110011001100110011001100110011001100";
    end;
apply "grp1_unload" 1 =;
        chain "chain1" =
"00110011001100110011001100110011001100110011001100\
                     
11001100110011001100110011001100110011001100110011\
                     
00110011001100110011001100110011001100110011001100\
                     
11001100110011001100110011001100110011001100110011\
                     
00110011001100110011001100110011001100110011001100\
                     
11001100110011001100110011001100110011001100110011\
                     
00110011001100110011001100110011001100110011001100\
                     
11001100110011001100110011001100110011001100110011\
                     
00110011001100110011001100110011001100110011001100\
                      1100110011001100110011001100110011001100110";
        chain "chain2" =
"00110011001100110011001100110011001100110011001100\
                     
11001100110011001100110011001100110011001100110011\
                     
00110011001100110011001100110011001100110011001100\
                     
11001100110011001100110011001100110011001100110011\
                     
00110011001100110011001100110011001100110011001100\
                     
11001100110011001100110011001100110011001100110011\
                     
00110011001100110011001100110011001100110011001100\
                     
11001100110011001100110011001100110011001100110011\
                     
00110011001100110011001100110011001100110011001100\
                      110011001100110011001100110011001100110011X";
        chain "chain3" =
"00110011001100110011001100110011001100110011001100\
                     
11001100110011001100110011001100110011001100110011\
                     
00110011001100110011001100110011001100110011001100\
                     
11001100110011001100110011001100110011001100110011\
                     
00110011001100110011001100110011001100110011001100\
                     
11001100110011001100110011001100110011001100110011\
                     
00110011001100110011001100110011001100110011001100\
                     
11001100110011001100110011001100110011001100110011\
                     
00110011001100110011001100110011001100110011001100\
                      110011001100110011001100110011001100110011X";
        chain "chain4" =
"00110011001100110011001100110011001100110011001100\
                     
11001100110011001100110011001100110011001100110011\
                     
00110011001100110011001100110011001100110011001100\
                     
11001100110011001100110011001100110011001100110011\
                     
00110011001100110011001100110011001100110011001100\
                     
11001100110011001100110011001100110011001100110011\
                     
00110011001100110011001100110011001100110011001100\
                     
11001100110011001100110011001100110011001100110011\
                     
00110011001100110011001100110011001100110011001100\
                      110011001100110011001100110011001100110011X";
        chain "chain5" =
"00110011001100110011001100110011001100110011001100\
                     
11001100110011001100110011001100110011001100110011\
                     
00110011001100110011001100110011001100110011001100\
                     
11001100110011001100110011001100110011001100110011\
                     
00110011001100110011001100110011001100110011001100\
                     
11001100110011001100110011001100110011001100110011\
                     
00110011001100110011001100110011001100110011001100\
                     
11001100110011001100110011001100110011001100110011\
                     
00110011001100110011001100110011001100110011001100\
                      110011001100110011001100110011001100110011X";
 chain "chain6" = "00110011001100110011001100110011001100110011001100\
                     
11001100110011001100110011001100110011001100110011\
                     
00110011001100110011001100110011001100110011001100\
                     
11001100110011001100110011001100110011001100110011\
                     
00110011001100110011001100110011001100110011001100\
                     
11001100110011001100110011001100110011001100110011\
                     
00110011001100110011001100110011001100110011001100\
                     
11001100110011001100110011001100110011001100110011\
                     
0011001100110011001100110011001XXXXXXXXXXXXXXXXXXX\
                      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
        chain "chain7" =
"00110011001100110011001100110011001100110011001100\
                     
11001100110011001100110011001100110011001100110011\
                     
00110011001100110011001100110011001100110011001100\
                     
11001100110011001100110011001100110011001100110011\
                     
00110011001100110011001100110011001100110011001100\
                     
11001100110011001100110011001100110011001100110011\
                     
00110011001100110011001100110011001100110011001100\
                     
11001100110011001100110011001100110011001100110011\
                     
001100110011001100110011001100XXXXXXXXXXXXXXXXXXXX\
                      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX";
    end;
end;


SCAN_CELLS =
~


------------------------------

Date: 30 Aug 2001 18:24:06 GMT
From: clay@panix.com (Clay Irving)
Subject: Re: combining varibles
Message-Id: <slrn9ot16p.cr1.clay@panix3.panix.com>

In article <9mlkib$2v3ut$1@ID-106172.news.dfncis.de>, Alex Green wrote:

> Urrr, not sure, I have tried this but wasnt to sure about what the result
> would be, at the moment I am trying to find where I am getting 'Unmatched
> ".' from, I can't see anything really obvious, any suggestions?

Example:

  #!/usr/local/bin/perl5.6.0 -w
  
  $fn = "Joe";
  $ln = "Mamma";
  
  $name = $fn . $ln;
  print "$name\n";
  
  $name = "$fn $ln";
  print "$name\n";
  
  $name= $fn . " " . $ln;
  print "$name\n";
  
Result:
  
  JoeMamma
  Joe Mamma
  Joe Mamma


-- 
Clay Irving <clay@panix.com>
Every revolution evaporates and leaves behind only the slime of a new
bureaucracy. 
- Franz Kafka 


------------------------------

Date: Thu, 30 Aug 2001 19:11:06 -0000
From: Craig Berry <cberry@cinenet.net>
Subject: Re: combining varibles
Message-Id: <Xns910D7BF3E21EEcberrycinenetnet1@207.126.101.92>

"Alex Green" <alexdgreen@hotmail.com> wrote in
news:9mljba$2r1m3$1@ID-106172.news.dfncis.de: 
> Right well basically I have a perl/cgi script retreiving values from an
> html form, with a first name and a last name field and what I need is
> these to vars, lets say $fn and $ln to become combined to become
> $owner. 

  $owner = "$fn $ln";    # Assuming you want a space between them;
                         # leave it out if not, or use
  $owner = $fn . $ln;    # instead.

> Not really sure whether combine is the right word,

Usually 'concatenate' is used for this string-combining operation.  'String 
interpolation' descibes my first proposed method above.

> but basically I need
> to be able to print them as an entire text string.  Does that make
> sense? 

If all you want to do is print them, then there's no need to build a 
separate variable to hold a concatenated form; just print them both as you'd 
like them to be combined in the output.

  print "$fn $ln";

-- 
Craig Berry <http://www.cinenet.net/~cberry/>
"That which is now known, was once only imagined." - William Blake



------------------------------

Date: Thu, 30 Aug 2001 18:43:16 GMT
From: cfedde@fedde.littleton.co.us (Chris Fedde)
Subject: Re: Comparing two dates! Is there an easy way?
Message-Id: <8Pvj7.833$V3.318848512@news.frii.net>

In article <9mlqb3$ndc$1@plutonium.btinternet.com>,
Peter Mann <Pcmann1@btinternet.com> wrote:
>Dear all!
>I have a problem trying to compare the date from two DateEntry widgets. I
>need to compare the date so that the 'endDate' is after 'startDate'. Is
>there an easy way to do this, I can't find a relevant methods in localtime.
>Therefore, is the only alternative to code this using a veriety of if
>statements for day, month and year? Or is there some easier method?
>
>

The standard library includes Time::Local which exports timelocal and
timegmt.  These gives a way of going from an array as returned from localtime
and gmtime into epoch seconds.

There are also other modules available on CPAN that do a great job
of converting wierd and wonderful formats into epoch seconds and back again.
Personaly I'm favorable to Time::ParseDate and Date::Calc.

Good Luck
-- 
    This space intentionally left blank


------------------------------

Date: Thu, 30 Aug 2001 14:59:13 -0400
From: brian d foy <comdog@panix.com>
Subject: Re: Comparing two dates! Is there an easy way?
Message-Id: <comdog-A810EB.14591330082001@news.panix.com>

In article <9mlqb3$ndc$1@plutonium.btinternet.com>, "Peter Mann" 
<Pcmann1@btinternet.com> wrote:

> I have a problem trying to compare the date from two DateEntry widgets. I
> need to compare the date so that the 'endDate' is after 'startDate'.

sounds like a job for one of the many Date::* modules. :)

    http://search.cpan.org/search?mode=module&query=Date

-- 
brian d foy <comdog@panix.com> - Perl services for hire
CGI Meta FAQ - http://www.perl.org/CGI_MetaFAQ.html
Troubleshooting CGI scripts - http://www.perl.org/troubleshooting_CGI.html



------------------------------

Date: Thu, 30 Aug 2001 13:23:05 -0700
From: "Godzilla!" <godzilla@stomp.stomp.tokyo>
Subject: Re: Comparing two dates! Is there an easy way?
Message-Id: <3B8EA0A9.67919BA2@stomp.stomp.tokyo>

Peter Mann wrote:

(snipped)

> I have a problem trying to compare the date from two DateEntry widgets. I
> need to compare the date so that the 'endDate' is after 'startDate'.

>   my $start     = $startDate->get;           # 06/08/2001
>   my $complete  = $endDate  ->get;      # 04/08/2001


Dates in this format you display are very easily sorted and,
there is no need for stereotypical Perl 5 Cargo Cult modules.

Look over my code. Shirley you will figure out how to adapt this.


Godzilla!  Queen Of Epochia.
--

#!perl

print "Content-type: text/plain\n\n";

$date1 = "12/31/2001";
$date2 = "04/01/2001";
$date3 = "10/09/2001";
$date4 = "01/01/2001";
$date5 = "11/13/2001";
$date6 = "04/02/2001";

push (@Sort_Dates, $date1, $date2, $date3, $date4, $date5, $date6);
@Sort_Dates = sort (@Sort_Dates);
print "@Sort_Dates";

PRINTED RESULTS:
________________

01/01/2001 04/01/2001 04/02/2001 10/09/2001 11/13/2001 12/31/2001


------------------------------

Date: 30 Aug 2001 16:44:58 -0400
From: Vinny Murphy <vmurphy@Cisco.Com>
Subject: Re: Comparing two dates! Is there an easy way?
Message-Id: <m3heupl1kl.fsf@vpnrel.cisco.com>

"Godzilla!" <godzilla@stomp.stomp.tokyo> writes:

> Peter Mann wrote:
> 
> (snipped)
> 
> > I have a problem trying to compare the date from two DateEntry widgets. I
> > need to compare the date so that the 'endDate' is after 'startDate'.
> 
> >   my $start     = $startDate->get;           # 06/08/2001
> >   my $complete  = $endDate  ->get;      # 04/08/2001
> 
> 
> Dates in this format you display are very easily sorted and,
> there is no need for stereotypical Perl 5 Cargo Cult modules.

The cargo cult module of Date::Manip would be better served than the
incorrect data below.  Case in point - if you change 04/01/2001 to
04/01/3030 it wouldn't sort correctly.



> 
> Look over my code. Shirley you will figure out how to adapt this.
> 
> 
> Godzilla!  Queen Of Epochia.
> --
> 
> #!perl
> 
> print "Content-type: text/plain\n\n";
> 
> $date1 = "12/31/2001";
> $date2 = "04/01/2001";
> $date3 = "10/09/2001";
> $date4 = "01/01/2001";
> $date5 = "11/13/2001";
> $date6 = "04/02/2001";
> 
> push (@Sort_Dates, $date1, $date2, $date3, $date4, $date5, $date6);
> @Sort_Dates = sort (@Sort_Dates);
> print "@Sort_Dates";
> 
> PRINTED RESULTS:
> ________________
> 
> 01/01/2001 04/01/2001 04/02/2001 10/09/2001 11/13/2001 12/31/2001

Changing $date4 to 04/01/3030:

01/01/2001 04/01/3030 04/02/2001 10/09/2001 11/13/2001 12/31/2001

-- 
Vinny


------------------------------

Date: 30 Aug 2001 13:50:53 -0700
From: gnarinn@hotmail.com (gnari)
Subject: Re: DBI connect string for Sybase Anywhere Studio (Update)
Message-Id: <21a477e8.0108301250.d97821a@posting.google.com>

Klaus Koch <kkoch@kxsu.de> wrote in message news:<9mgq15$1ufg6$1@ID-101758.news.dfncis.de>...
> Klaus Koch wrote:
> 
> > I want to connect to a Sybase Anywhere Studio database with the DBD::ODBC
> > module. The database server is called "limes" and the database is called
> > "customers".
> > I dont know what to use in the connect string to get access to the
> > database.
> > I tried:
> > $dbh = DBI->connect("dbi:ODBC:'uid=<user>;pwd=<pwd>;eng=limes'");
> > but I get a connection error.

the datasource string look strange here. maybe you meant
  $dbh = DBI->connect("dbi:ODBC:uid=<user>;pwd=<pwd>;eng=limes");

also the DBD:ODBC docs mention a test program to test connectivity,
odbctest. did you try that?

> it doesnt matter what i try, i keep getting this error:
> 
> DBI->connect('uid=<user>;pwd=<pwd>;eng=limes') failed: [iODBC][Driver 
> Manager]Invalid string or buffer length (SQL-S1090)
> [iODBC][Driver Manager]Data source name not found and no default driver 
> specified. Driver could not be loaded (SQL-IM002)(DBD: db_login/SQLConnect 
> err=-1) at line 6

i do not know anything about ODBC, but should not the datasource string
contain a 'driver=' and a 'database=' field?

did you read perldoc DBD::ODBC ?

gnari


------------------------------

Date: Thu, 30 Aug 2001 20:16:45 +0100
From: "Nathan Randle" <nathan.randle@ntlworld.com>
Subject: Deleting files?
Message-Id: <mkwj7.11230$Nb2.1945107@news2-win.server.ntlworld.com>

I am writing a script which uses an installation file to prevent people
creating errors in the script and I want the installion file to be
automatically deleted off the server once configured. How do I do this?

Thx.

Nathan.




------------------------------

Date: 30 Aug 2001 19:32:43 GMT
From: trammell@haqq.hypersloth.invalid (John J. Trammell)
Subject: Re: Deleting files?
Message-Id: <slrn9otkcb.84b.trammell@haqq.hypersloth.net>

On Thu, 30 Aug 2001 20:16:45 +0100, Nathan Randle wrote:
> I am writing a script which uses an installation file to prevent people
> creating errors in the script and I want the installion file to be
> automatically deleted off the server once configured. How do I do this?

I'm curious about what research you did on your own before
asking CLPM for help.

-- 
I don't know what the hell is going on dude, but this suspension gives
me more time for fraggin'.  Yee haw!


------------------------------

Date: Thu, 30 Aug 2001 20:34:59 +0100
From: "Nathan Randle" <nathan.randle@ntlworld.com>
Subject: Re: Deleting files?
Message-Id: <tBwj7.11271$Nb2.1996591@news2-win.server.ntlworld.com>

Yeah ok sorry. i've been looking through Perl documents all day at useless
stuff and I post one message when I could've posted dozens and you start
stressing. Chill out m8. I wont do it again ok?

John J. Trammell <trammell@haqq.hypersloth.invalid> wrote in message
news:slrn9otkcb.84b.trammell@haqq.hypersloth.net...
> On Thu, 30 Aug 2001 20:16:45 +0100, Nathan Randle wrote:
> > I am writing a script which uses an installation file to prevent people
> > creating errors in the script and I want the installion file to be
> > automatically deleted off the server once configured. How do I do this?
>
> I'm curious about what research you did on your own before
> asking CLPM for help.
>
> --
> I don't know what the hell is going on dude, but this suspension gives
> me more time for fraggin'.  Yee haw!




------------------------------

Date: 30 Aug 2001 20:08:15 GMT
From: trammell@haqq.hypersloth.invalid (John J. Trammell)
Subject: Re: Deleting files?
Message-Id: <slrn9otmev.89h.trammell@haqq.hypersloth.net>

On Thu, 30 Aug 2001 20:34:59 +0100, Nathan Randle wrote:
[toppost fixed]
> John J. Trammell <trammell@haqq.hypersloth.invalid> wrote in message
> news:slrn9otkcb.84b.trammell@haqq.hypersloth.net...
> > On Thu, 30 Aug 2001 20:16:45 +0100, Nathan Randle wrote:
> > > I am writing a script which uses an installation file to prevent people
> > > creating errors in the script and I want the installion file to be
> > > automatically deleted off the server once configured. How do I do this?
> >
> > I'm curious about what research you did on your own before
> > asking CLPM for help.
> >
> Yeah ok sorry. i've been looking through Perl documents all day at useless
> stuff and I post one message when I could've posted dozens and you start
> stressing. Chill out m8. I wont do it again ok?

Dude, I am ch1ll3d.  I am so cool that when I bust a yack after pounding
forties wit my homies, they call it "frost heave".  What I'm trying to
SIZZAY is that if your request for help looks like:

  I was trying to do X, and I couldn't make X happen, so I
  read documents Y and Z, and I still don't get it, what
  am I missing?

that you are more likely to get a useful response than if it looks
like:

  How do I do X?

I'm not trying to be a b4d4ss -- I'm just telling you how it is.
Don't shoot the messenger.  Nome sain?

-- 
It's clear that the crew to send to Mars must be comprised of midget
eunuchs.


------------------------------

Date: Thu, 30 Aug 2001 14:57:13 -0400
From: brian d foy <comdog@panix.com>
Subject: Re: Difference between .pl, .cgi, and .pm File Extensions.
Message-Id: <comdog-7F4C9F.14571330082001@news.panix.com>

In article <h1usotogbc2s5vrftjvmf2r6s1cqe53k94@4ax.com>, 
bob@eawf.nospam.com wrote:

> What I'm starting to glean out of this is that Perl Modules need to be
> Installed onto a server or into Perl itself.  Is that right?

well, any code that you intend to pull into your scripts need
to be available for perl to read.  that commonly means that
the code needs to be installed with perl.  this is true for
any sort of file, including perl libraries, modules, Data::Dumper
files, or anything else.

until something like Autoloader can fetch code over the net
somehow, you're stuck with installing what you need locally
or on a shared drive.

-- 
brian d foy <comdog@panix.com> - Perl services for hire
CGI Meta FAQ - http://www.perl.org/CGI_MetaFAQ.html
Troubleshooting CGI scripts - http://www.perl.org/troubleshooting_CGI.html



------------------------------

Date: 30 Aug 2001 18:31:57 GMT
From: clay@panix.com (Clay Irving)
Subject: Re: Extracting data from emails
Message-Id: <slrn9ot1lg.cr1.clay@panix3.panix.com>

In article <9mlpbv$gsa$1@news8.svr.pol.co.uk>, Graeme wrote:

> Help!
> 
> I've been told that using perl it is possible to create a script that
> extracts data from an email to create a text file?!?
> 
> I have a form that I receive from a web site that contains fixed fields, I
> would like this exporting to a text file so that I can import this into my
> Access database.
> 
> Anyone know where I can get such a script, needless to say I'm not a perl
> expert!

You're question is *way* too general -- Start with extracting data from
fixed format files:

Example:

  #!/usr/local/bin/perl5.6.0 -w
  
  $fixed_field = "1234567890ABCDEFGH";
  
  ($numbers, $letters) = unpack(a10a8, $fixed_field);
  print "$numbers and $letters\n";
  
Result:

  1234567890 and ABCDEFGH

Work from there and clearly explain your problem/question.

-- 
Clay Irving <clay@panix.com>
Hatred is gained as much by good works as by evil. 
- Niccolo Machiavelli 


------------------------------

Date: 30 Aug 2001 11:20:25 -0700
From: demerphq@hotmail.com (Yves Orton)
Subject: Re: FAQ asking (was Re: CODE reference to member function of package Confusing..)
Message-Id: <74f348f7.0108301020.263c1d4a@posting.google.com>

tadmc@augustmail.com (Tad McClellan) wrote in message news:<slrn9onlng.sj0.tadmc@tadmc26.august.net>...
> 194.203.212.8 [demerphq@hotmail.com] <194.203.212.8[demerphq@hotmail.com]> wrote:
> 
> >In the future when the urge to write a mail like that comes on I will write it to myself first.
> 
> 
> Just "count to ten" first:

Actually im going to take my fathers advice (for once) and just wait
till the next day...

Incidentally, I apologised in private and it was accepted.

So once again to anyone else i offended my regets.

yves


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

To request back copies (available for a week or so), send your request
to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
where x is the volume number and y is the issue number.

For other requests pertaining to the digest, send mail to
perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
sending perl questions to the -request address, I don't have time to
answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V10 Issue 1660
***************************************


home help back first fref pref prev next nref lref last post