[22471] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4692 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Tue Mar 11 00:05:51 2003

Date: Mon, 10 Mar 2003 21:05:06 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Mon, 10 Mar 2003     Volume: 10 Number: 4692

Today's topics:
        Can Someone Help me with my news page? <matt307@carolina.rr.com>
    Re: how to join 2 text files sql style in perl <maustin@firstdbasource.com>
    Re: Merging log files using hash - good idea/possible? <tore@aursand.no>
        my $x = 100 for 1..3; why is $x undef (John Lin)
    Re: my $x = 100 for 1..3; why is $x undef <wuerz@yahoo.com>
    Re: my $x = 100 for 1..3; why is $x undef <s_grazzini@hotmail.com>
    Re: new Perl feature request: call into shared libs <no.spam@gknw.de>
    Re: new Perl feature request: call into shared libs (Bryan Castillo)
    Re: new Perl feature request: call into shared libs <nospam-abuse@ilyaz.org>
    Re: new Perl feature request: call into shared libs <para@tampabay.rr.com>
        Perl > Outlook meeting request (Dennis Ayzin)
    Re: perl to strip high-end ASCII <REMOVEsdnCAPS@comcast.net>
    Re: perl to strip high-end ASCII <jurgenex@hotmail.com>
    Re: Perl Vs C,C++ <jkeen@concentric.net>
        printing a file to a webpage <matt307@carolina.rr.com>
    Re: Re to all <noreply@gunnar.cc>
    Re: Re to all <tore@aursand.no>
    Re: Re to all <jurgenex@hotmail.com>
    Re: remove anything from string except two words <noreply@gunnar.cc>
        Sorting array of hash references by a hash key <lib_sys@yahoo.ca>
    Re: Sorting array of hash references by a hash key <uri@stemsystems.com>
        Stumped on cgi... <jjk3@msstate.edu>
    Re: Stumped on cgi... <rm@no-mail.com>
    Re: Stumped on cgi... <jjk3@msstate.edu>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Tue, 11 Mar 2003 01:10:55 GMT
From: matt307 <matt307@carolina.rr.com>
Subject: Can Someone Help me with my news page?
Message-Id: <3E6D3797.B89F8D05@carolina.rr.com>

Hey everyone. I am stuck on writing a news script for my website. I was
wondering if anyone could help. goto
www.chaoslegion.netfirms.com/scripts/postnews.htm and just type in
whatever. then you hit send and that one works ok. but after that i cant
figure out how to get messages.txt to post below where it says news in
the middle frame. any help qould be appreciated. thx






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

Date: Tue, 11 Mar 2003 03:11:04 GMT
From: Michael Austin <maustin@firstdbasource.com>
Subject: Re: how to join 2 text files sql style in perl
Message-Id: <3E6D52B3.589194E8@firstdbasource.com>

Jeff Zucker wrote:
> 
> Domenico Discepola wrote:
> 
> > I appreciate everyone's honest opinion.  The reason that I didn't want
> > to use any external packages is that I was having problems getting
> > them to work (I don't wish to discuss this further, as this isn't the
> > purpose of this post).
> 
> Perhaps your problems with getting the modules to work are not relevant
> to you.  But they are relevant to me (author of DBD::AnyData and
> maintainer of DBD::CSV) and to other users of the modules.  If you have
> time to drop me a note off list about the problems you encountered, it
> may benefit others.
> 
> --
> Jeff


hmmmm.. the DBD::CSV looks very promising for a project I am working on
-- on VMS. Downloading it now...


Regards,

Michael Austin            OpenVMS User since June 1984
First DBA Source, Inc.    Registered Linux User #261163


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

Date: Tue, 11 Mar 2003 02:41:45 +0100
From: "Tore Aursand" <tore@aursand.no>
Subject: Re: Merging log files using hash - good idea/possible?
Message-Id: <pan.2003.03.10.23.57.04.555501@aursand.no>

On Mon, 10 Mar 2003 21:06:00 +0000, Paul Silver wrote:
> Where I work we use Webtrends to analyse our web server stats. We run a
> cluster so it creates two sets of logs, which Webtrends can't handle
> unless we buy a very expensive upgrade, so I'd like to use Perl to merge
> the files in to one so it can be read.

Nothing to do with Perl, but I once encountered the same problem as you; I
wanted to try out WebTrends on something else than just one logfile.

The solution I ended up with was a great - and small - utility developed
in C/C++ which was called 'something'. :)  That's the problem; I don't
remember the name of the program, but it wasn't something like 'log
merge', 'merge log' or something.

It was very fast and, sorted the entries by date, and - as it turned out -
seemed to work. :)

Tell me if you don't find it anywhere (use www.google.com).  Maybe I can
help.


-- 
Tore Aursand <tore@aursand.no>



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

Date: 10 Mar 2003 17:30:29 -0800
From: johnlin@chttl.com.tw (John Lin)
Subject: my $x = 100 for 1..3; why is $x undef
Message-Id: <a73bcad1.0303101730.707a3370@posting.google.com>

Dear all,

use strict;
my $x = 100 for 1..3;
print defined $x? $x: '<undef>';
__END__
<undef>

Eh?  Shouldn't $x be 100?  What is the trick here?

NOTE: I 'use strict', and $x is not a reserved (globally defined) variable.
So I think 'scoping' is not the problem.

Best regards.
John Lin


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

Date: 10 Mar 2003 20:41:08 -0500
From: Mona Wuerz <wuerz@yahoo.com>
Subject: Re: my $x = 100 for 1..3; why is $x undef
Message-Id: <m3vfyqof2j.fsf@karrooite.njitdm.campus.njit.edu>

johnlin@chttl.com.tw (John Lin) writes:

> use strict;
> my $x = 100 for 1..3;

that's equivalent to 

for (1..3) {
        my $x = 100
}

so $x is scoped to the for loop.

> print defined $x? $x: '<undef>';
> __END__
> <undef>
> 
> Eh?  Shouldn't $x be 100?  What is the trick here?

If, hypothetically, the statement

my $x = 100 for 1..3;

was equivalent to 

my $x = 100;
my $x = 100;
my $x = 100;

then, with warnings enabled you'd get a warning 

   "my" variable $x masks earlier declaration in same scope at...

- but you don't, so -

> NOTE: I 'use strict', and $x is not a reserved (globally defined) variable.
> So I think 'scoping' is not the problem.

- it's scoping after all.

-- 
$_="\n,rekcah egnufeB rehtona tsuJ";#v1<?>g\:pv-<5<
s s\S+(?:B)sunpack'u',q q$;')E4qsee;#>60#^<(v!<)g6<
print scalar reverse,$@ unless m,[+;#]55,;m:_,:#^1<


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

Date: Tue, 11 Mar 2003 02:34:31 GMT
From: Steve Grazzini <s_grazzini@hotmail.com>
Subject: Re: my $x = 100 for 1..3; why is $x undef
Message-Id: <XWbba.78832$Mh3.23846314@twister.nyc.rr.com>

John Lin <johnlin@chttl.com.tw> writes:
> 
> use strict;
> my $x = 100 for 1..3;
> print defined $x? $x: '<undef>';
> __END__
> <undef>
> 
> Eh?  Shouldn't $x be 100?  What is the trick here?
> 
> NOTE: I 'use strict', and $x is not a reserved 
> (globally defined) variable.  So I think 'scoping' 
> is not the problem.
> 

Actually it *is* a scoping problem.  

The foreach modifier -- unbeknownst to the parser,
apparently -- creates a scope, and so your print
statement ends up referring to an undeclared pad
variable in the "outer" scope.

Pretty good bug; you should report it.

  $ perldoc perlbug

-- 
Steve


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

Date: Tue, 11 Mar 2003 00:35:24 +0100
From: Guenter <no.spam@gknw.de>
Subject: Re: new Perl feature request: call into shared libs
Message-Id: <3E6D213C.1020805@gknw.de>

Hi Ilya,

Ilya Zakharevich schrieb:
> A simple question: can you call the function f1000 given above?
I dont know; and its unimportant for me; what I wanted to do I did already;
and maximum I called was a function with 10 params, and this worked fine.
Maybe I find some functions in the API I'm calling that need 12 or 15 
params, but that's it - and i hope this will work too...
so I think you are thinking too much of non-existing functions and an 
univeral approach; istead it's normaly to 99% enough to support 15 or 20 
args...
a module like Win32:API is on every platform a perfect utility to do 
some simple calls into libs for which an own .xs module is much 
overhead...; specially on platforms where no compiler belongs to the OS...

Guenter.



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

Date: 10 Mar 2003 15:06:35 -0800
From: rook_5150@yahoo.com (Bryan Castillo)
Subject: Re: new Perl feature request: call into shared libs
Message-Id: <1bff1830.0303101506.52595138@posting.google.com>

Ilya Zakharevich <nospam-abuse@ilyaz.org> wrote in message news:<b4gcqk$1vgq$1@agate.berkeley.edu>...
> [A complimentary Cc of this posting was sent to
> Bryan Castillo
> <rook_5150@yahoo.com>], who wrote in article <1bff1830.0303081309.752facce@posting.google.com>:
> > > non-portability of such a call.  E.g., I do not know how to write i386
> > > assembler which would call a C function with n long arguments; here n
> > > is a variable number given as a parameter:
> > > 
> > >   void
> > >   call_many_longs(void (*f)(), long n, long *array_of_arguments)
> > >   {
> > >     __asm__("???");
> > >   }
> > 
> > (This should work on Linux/i386 using gcc/gas? I only tried 0 to 6 32 bit args)
> > 
> > _call_fptr:
> >         pushl   %ebp            /* save register */
> >         movl    %esp, %ebp      /* setup ebp for reference */
> ...
> 
> >         movl    8(%ebp), %eax   /* get the function pointer */
> >         call    *%eax           /* call the function */
> > 
> >         movl    -4(%ebp), %ecx  /* restore register */
> 
> Of course, if you know that a particular register is preserved during
> the call, then there is the place to store the number of arguments so
> it survives during the call, and one can adjust ESP accordingly.

I always thought that well behaved functions preserve the registers
for the caller.  (Of course this is what my Instructor for Motorolla
assembly had us do.)

> And
> I see that even with -fomit-frame-pointer gcc is doing
> 
> 		     popl %ebx
> 		     popl %esi
> 		     popl %edi
> 		     popl %ebp
> 		     ret
> 
> so it preserves 4 registers (including EBP you used).  Is it a
> universally accepted ABI on all x86-hosted OSes and all compilers?  If
> yes, then indeed this particular problem is not a problem.

It looks to me like ebp should always be preserved, it is used as a
base reference to where ESP was upon function entry.  I think all
general purpose registers except eax should be preserved, I believe
eax is normally where return values are placed.  (doubles are
different though, there are instructions for storing and returning
them - I don't understand yet).

Documents from Intel talk about this convention. There are 3 manuals
for Intel you can see.

http://developer.intel.com/design/pentium4/manuals/245470.htm

See volume 2, Chapter 6, regarding the ENTER and LEAVE instructions.

I also noticed that doubles are passed to functions as 2 sets of 32
bit values.

>From perl you could even pack the doubles and, then break them apart
and pass them into the function.  This probably applies to 12 byte
values like (long double) also.

I checked out asm generated by Visual C++ and the conventions look the
same as GCC under linux.

> 
> Thanks,
> Ilya



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

Date: Tue, 11 Mar 2003 02:08:04 +0000 (UTC)
From: Ilya Zakharevich <nospam-abuse@ilyaz.org>
Subject: Re: new Perl feature request: call into shared libs
Message-Id: <b4jge4$31i3$1@agate.berkeley.edu>

[A complimentary Cc of this posting was sent to
Bryan Castillo
<rook_5150@yahoo.com>], who wrote in article <1bff1830.0303101506.52595138@posting.google.com>:
> > Of course, if you know that a particular register is preserved during
> > the call, then there is the place to store the number of arguments so
> > it survives during the call, and one can adjust ESP accordingly.
> 
> I always thought that well behaved functions preserve the registers
> for the caller.  (Of course this is what my Instructor for Motorolla
> assembly had us do.)

> > 		     popl %ebx
> > 		     popl %esi
> > 		     popl %edi
> > 		     popl %ebp
> > 		     ret

As you see from this example, only 4 registers out of 7 are restored.
Of course, EAX contains the return value, so it can't be preserved.
But also ECX and EDX are not preserved.

> It looks to me like ebp should always be preserved, it is used as a
> base reference to where ESP was upon function entry.

Since this "feature" is useful during debugging only (? maybe some
exception handling code uses EBP too?), some very-optimizing compiler
*might* omit this code.

> I think all general purpose registers except eax should be preserved

This is definitely not what I see (even with pretty low optimization
settings: -O2 -fomit-frame-pointer of gcc 2.8.1).

> I believe eax is normally where return values are placed.

4-byte long ones - yes.  I do not know how structs are returned (with
or without __regparam__(3))

> Documents from Intel talk about this convention. There are 3 manuals
> for Intel you can see.
> 
> http://developer.intel.com/design/pentium4/manuals/245470.htm
> 
> See volume 2, Chapter 6, regarding the ENTER and LEAVE instructions.

AFAIK, Nobody uses enter/leave.

Ilya



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

Date: Tue, 11 Mar 2003 02:51:07 GMT
From: "Matt Taylor" <para@tampabay.rr.com>
Subject: Re: new Perl feature request: call into shared libs
Message-Id: <vacba.19122$Xu4.533273@twister.tampabay.rr.com>

"Bryan Castillo" <rook_5150@yahoo.com> wrote in message
news:1bff1830.0303101506.52595138@posting.google.com...
> Ilya Zakharevich <nospam-abuse@ilyaz.org> wrote in message
news:<b4gcqk$1vgq$1@agate.berkeley.edu>...
> > [A complimentary Cc of this posting was sent to
> > Bryan Castillo
> > <rook_5150@yahoo.com>], who wrote in article
<1bff1830.0303081309.752facce@posting.google.com>:
> > > > non-portability of such a call.  E.g., I do not know how to write
i386
> > > > assembler which would call a C function with n long arguments; here
n
> > > > is a variable number given as a parameter:
> > > >
> > > >   void
> > > >   call_many_longs(void (*f)(), long n, long *array_of_arguments)
> > > >   {
> > > >     __asm__("???");
> > > >   }
> > >
> > > (This should work on Linux/i386 using gcc/gas? I only tried 0 to 6 32
bit args)
> > >
> > > _call_fptr:
> > >         pushl   %ebp            /* save register */
> > >         movl    %esp, %ebp      /* setup ebp for reference */
> > ...
> >
> > >         movl    8(%ebp), %eax   /* get the function pointer */
> > >         call    *%eax           /* call the function */
> > >
> > >         movl    -4(%ebp), %ecx  /* restore register */
> >
> > Of course, if you know that a particular register is preserved during
> > the call, then there is the place to store the number of arguments so
> > it survives during the call, and one can adjust ESP accordingly.
>
> I always thought that well behaved functions preserve the registers
> for the caller.  (Of course this is what my Instructor for Motorolla
> assembly had us do.)

It's entirely up to convention. Some conventions are anal about reigster
preservation. Others aren't. The esp register has to be preserved, but one
difference between calling conventions is whether the called function or
calling function must clean the stack up.

> > And
> > I see that even with -fomit-frame-pointer gcc is doing
> >
> >      popl %ebx
> >      popl %esi
> >      popl %edi
> >      popl %ebp
> >      ret
> >
> > so it preserves 4 registers (including EBP you used).  Is it a
> > universally accepted ABI on all x86-hosted OSes and all compilers?  If
> > yes, then indeed this particular problem is not a problem.
>
> It looks to me like ebp should always be preserved, it is used as a
> base reference to where ESP was upon function entry.  I think all
> general purpose registers except eax should be preserved, I believe
> eax is normally where return values are placed.  (doubles are
> different though, there are instructions for storing and returning
> them - I don't understand yet).

Both VC and GCC on x86 preserve ebx, esi, edi, ebp, and obviously esp.
32-bit return values are returned in the eax register, 64-bit return values
are usually (?) returned with the upper 32 bits in edx and the lower 32 bits
in eax. Sometimes floating-point values get passed around on the FPU stack.
(I don't know any of the floating-point rules for x86 calling conventions.)

> Documents from Intel talk about this convention. There are 3 manuals
> for Intel you can see.
>
> http://developer.intel.com/design/pentium4/manuals/245470.htm
>
> See volume 2, Chapter 6, regarding the ENTER and LEAVE instructions.

Intel offers machine support for a frame pointer & nested functions with the
enter and leave instructions, but this isn't what C/C++ compilers use. In
fact you will rarely see the enter instruction used at all.

GCC & VC both offer frame pointer omission optimizations thus freeing ebp
for general use. Most x86 compilers also offer register parameter schemes.
There are several different ways to call a function. Also, Windows system
libraries use a convention where the callee cleans the stack. (There is an
exception -- wsprintf uses a caller-cleaned stack.) Other conventions have
the caller clean the stack. GCC generates code for the latter, I believe.

> I also noticed that doubles are passed to functions as 2 sets of 32
> bit values.

Not always. Depends on the compiler among other things. I have seen doubles
passed to a function and returned from a function using the FPU stack. (The
x87 has a stack of 8 registers that are used for computation.)

> >From perl you could even pack the doubles and, then break them apart
> and pass them into the function.  This probably applies to 12 byte
> values like (long double) also.
>
> I checked out asm generated by Visual C++ and the conventions look the
> same as GCC under linux.

Default convention (__cdecl) is the same. Windows system libraries are
compiled with __stdcall convention which is different. The following code
should suffice for any convention except a register-parameter scheme:

; void make_call(void *fp, void *stack, int num_params, int *retval)
_make_call:
 mov ecx, [esp+16]
 push ebp
 push esi
 shl ecx, 2
 push edi
 mov ebp, esp

 lahf
 sub esp, ecx
 shr ecx, 2
 mov esi, [ebp+20]
 mov edi, esp
 cld
 rep movsd
 sahf

 call [ebp+16]

 mov ecx, [ebp+28]
 mov [ecx], eax

 ; If 64-bit return value, also do next line
 ; mov [ecx+4], edx
 ; What about floating point?
 ; What about returning a structure?

 mov esp, ebp
 pop edi
 pop esi
 pop ebp
 ret

This code should work with C/C++ libraries on both *nix and Windows
regardless of convention as long as the function only returns a datatype
smaller than 32-bits that's not floating point.

-Matt




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

Date: 10 Mar 2003 20:53:39 -0800
From: da@kclawyers.net (Dennis Ayzin)
Subject: Perl > Outlook meeting request
Message-Id: <585d0f43.0303102053.169100e3@posting.google.com>

I need to send an e-mail with meeting request to several people. I
have no problems sending text or html message. The problem comes if I
create text/calendar header and send it to Outlook. The entire message
comes up as text e-mail with VEVENT and other coding. I've done some
research and even tested the system by sending an Outlook request from
Outlook, then parsing the file and re-sending it again. Every time as
soon as message is changed by perl or C it comes as text e-mail with
the entire code in it. In addition if I just copy the file with e-mail
into the mail folder of the user it comes as Outlook request with no
problems. Does anyone know how to overcome this problem.

Dennis
da@kclawyers.net


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

Date: Mon, 10 Mar 2003 18:40:01 -0600
From: "Eric J. Roode" <REMOVEsdnCAPS@comcast.net>
Subject: Re: perl to strip high-end ASCII
Message-Id: <Xns933AC81477966sdn.comcast@216.166.71.239>

-----BEGIN xxx SIGNED MESSAGE-----
Hash: SHA1

"Sean W. Ellis" <sellis@totallygeek.com> wrote in news:v6ptg7hnofi9e7
@corp.supernews.com:

> Was wondering if there was a quick and dirty way to strip high-end ASCII
> from a text file?
 ...
> 
> I looked from an ord function in perl, thinking in c I would look at it
> like:
> 
> // filter the next character
> 
> if ( ord(characternext)  > HIGHESTASCIIWANTED ) { 
>    //don't write the character to the dump file 
> }

Nah, don't do them one at a time with ord().  Do them all at once with tr!

    $string =~ tr/\000-\177//cd;

- -- 
Eric
print scalar reverse sort qw p ekca lre reh 
ts uJ p, $/.r, map $_.$", qw e p h tona e;

-----BEGIN xxx SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBPm0wZGPeouIeTNHoEQIoPQCgz3YaHoU8td/dSY+XP0TOxyCZoHwAn1tu
+15vAn1UdyKCDXMGVOL0IK+n
=0ptH
-----END PGP SIGNATURE-----


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

Date: Tue, 11 Mar 2003 02:43:51 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: perl to strip high-end ASCII
Message-Id: <H3cba.12442$iq1.5084@nwrddc02.gnilink.net>

Sean W. Ellis wrote:
> Was wondering if there was a quick and dirty way to strip high-end
> ASCII from a text file?

Please define high-end ASCII.

jue




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

Date: 10 Mar 2003 23:16:40 GMT
From: "James E Keenan" <jkeen@concentric.net>
Subject: Re: Perl Vs C,C++
Message-Id: <b4j6co$dno@dispatch.concentric.net>


"bab" <baburob987@yahoo.com> wrote in message
news:225390b8.0303101337.3074f8bd@posting.google.com...
> Hi
>  Does anyone have a listing of Perl Vs C, C++ not just from Object
> Oriented perspective alone. Basically that listing should give
> similarties, differences between Perl Vs C, C++.

See Appendix B.2 to Damian Conway's I<Object Oriented Perl>
L<http://www.manning.com/Conway/index.html>, Manning Publications, 2000.




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

Date: Tue, 11 Mar 2003 03:49:12 GMT
From: matt307 <matt307@carolina.rr.com>
Subject: printing a file to a webpage
Message-Id: <3E6D5CB2.2F102D5A@carolina.rr.com>

hey all, i am stuck.  i have a file messages.txt that i am having users
append.  However i can't figure out how to get messages.txt to be posted
to my webpage.  if this helps, what i am working on is at
www.chaoslegion.netfirms.com/scripts/postnews.htm  You can post the news
just find its just i cant get the newly updated file to post to the
website.  any help would be appreciated.  thanks!



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

Date: Tue, 11 Mar 2003 00:12:04 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: Re to all
Message-Id: <b4j66f$207d3n$1@ID-184292.news.dfncis.de>

Tintin wrote:
> I would find it very difficult to believe that you do all your
> development via FTP.  How the hell do you manage to edit the file
> with FTP?

Even if that comment was not directed to me, I have to say that I find
it very insulting. Any particular reason not to take the poster's word
for it??

Maybe it's time that some of you regulars start realizing that quite a 
few people are struggling with learning Perl and CGI without the 
'perfect' set-up for doing so. It's fine that you let them know about 
ActiveState, IndigoPerl etc., but don't stamp them as liers.

I have developed quite a few Perl scripts that way, before I discovered
IndigoPerl. When doing so, you have local copies, of course, edit them
locally, and upload new versions for testing. Inconvenient, yes, but
fully possible. And, again, no reason to insinuate that the poster did
not tell the truth!

/ Gunnar

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl



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

Date: Tue, 11 Mar 2003 02:41:45 +0100
From: "Tore Aursand" <tore@aursand.no>
Subject: Re: Re to all
Message-Id: <pan.2003.03.10.23.54.32.166668@aursand.no>

On Tue, 11 Mar 2003 00:12:04 +0100, Gunnar Hjalmarsson wrote:
>> I would find it very difficult to believe that you do all your
>> development via FTP.  How the hell do you manage to edit the file with
>> FTP?

> Even if that comment was not directed to me, I have to say that I find
> it very insulting. Any particular reason not to take the poster's word
> for it??

I don't think Tintin meant it as an insult;  I think he meant that it's
very _difficult for him to believe_ that one does all of the development
that way.

Why is it difficult for him - and me, actually - to believe that?  It's
extremely cumbersome to develop that way.

On the other hand;  As long as you're not on a dialup connection, there
are no problems editing remote files via FTP.  That doesn't mean that it's
a pretty solution, though.

> Maybe it's time that some of you regulars start realizing that quite a
> few people are struggling with learning Perl and CGI without the
> 'perfect' set-up for doing so. It's fine that you let them know about
> ActiveState, IndigoPerl etc., but don't stamp them as liers.

I agree with you here, and I think - and hope - that Tintin didn't mean
that Hum Rattle was a liar.

But!  Why don't people better - or more often - check out their options
when it comes to working with - or inside a - development environment?

Don't they understand that we live in 2003 and every decent language, Perl
is one of them of course, have a debugging method of some sort?  It's
quite frustrating to answer questions which the questionnaire easily could
have found the answer himself/herself if he/she just had taken a few
minutes to read some documentation.


-- 
Tore Aursand <tore@aursand.no>



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

Date: Tue, 11 Mar 2003 02:55:46 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Re to all
Message-Id: <Secba.12463$iq1.3444@nwrddc02.gnilink.net>

Hum Rattle wrote:
>> I don't believe you.
>> Are you seriously claiming that you are using WebTV or some other
>> device that doesn't have any shell as your software development
>> platform?
>
> Eever heard of webspace with just a ftp account and no shell access?

What does that have to do with developing Perl programs?

How do you access that ftp account? With your ball pen? Or with
Magic::Transcendent?
I bet you are using some computer running some OS and on any OS that I know
of you have some sort of shell access. La voila, you got your shell access.
Where is the problem?

>> Then go, no better run, to your nearest used computer dealer and get
>> an old 486 running Windows95. Actually people are happy to give them
>> away for free such that they don't have to pay the recycling fee.
>> Even that crummy piece would be a major improvment over your current
>> situation and is totally sufficient to develop and test Perl
>> programs.
>
> what has this to do with the problem?

In your original posting you claimed that
    " i have no access to a shell so i could'nt not see any error messages
from perl."

If that were true then buying an old 486 would remedy this problem for very
little money by providing you with a computer on which you can install an OS
which in turn would offer you a command shell.

> you just answered my question in
> posting
> news:7DIaa.2127$qB5.64@nwrddc01.gnilink.net.

Well, as your original posting was titled "Re to all" and had no reference
to whatever you may have been asking or posting before there was no way
telling what you were asking or posting before (or what anyone replied to
you).

jue




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

Date: Tue, 11 Mar 2003 00:28:33 +0100
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: remove anything from string except two words
Message-Id: <b4j75c$1vvl41$1@ID-184292.news.dfncis.de>

John W. Krahn wrote:
>>$oldstring="XZ-6666 XXX Systems Version 5.6(17) Copyright 2002"
>>
>>Now i want to cut out "XZ-6666" and "Version 5.6(17)".
>>
>>The XZ- and Version Number aren't the same everytime.
>>
>>It's always XZ-????  and Version ?.?(??)
>>
>>What makes it a little bit difficult, the order in which this things
>>occur, arent't the same evertime.
>>
>>Sometimes they're like: "Version 5.6(17)   Copyright 2002  XXX Systems
>>XZ-6666"
> 
> ( $newstring = $oldstring ) =~ s/Version\s+\d+\.\d+\(\d+\)|XZ-\d+//g;

I think that does exactly the opposite of what the poster wants (but he 
mentioned "cut out", so I'm not quite sure). ;-)

/ Gunnar

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl



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

Date: Mon, 10 Mar 2003 23:23:09 -0500
From: "Thomas D" <lib_sys@yahoo.ca>
Subject: Sorting array of hash references by a hash key
Message-Id: <pan.2003.03.11.04.23.08.363858@yahoo.ca>

Hello,

I use HTML::Template to generate a web page. When data retrieve from database,
the output is put in a array of hash references. Something like:
[
     { name => 'Apple',   color => 'Red',    shape => 'Round' },
     { name => 'Orange',  color => 'Orange', shape => 'Round' },
]
More info at: http://html-template.sourceforge.net/article.html

My question is: after getting the array of hash references, is there a way to
sort the array by a hash key, eg. key "color"?

Thanks a lot,
Thomas


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

Date: Tue, 11 Mar 2003 04:45:01 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Sorting array of hash references by a hash key
Message-Id: <x765qqmrzn.fsf@mail.sysarch.com>

>>>>> "TD" == Thomas D <lib_sys@yahoo.ca> writes:

  TD> I use HTML::Template to generate a web page. When data retrieve
  TD> from database, the output is put in a array of hash
  TD> references. Something like:

  TD> [
  TD>      { name => 'Apple',   color => 'Red',    shape => 'Round' },
  TD>      { name => 'Orange',  color => 'Orange', shape => 'Round' },
  TD> ]

  TD> My question is: after getting the array of hash references, is
  TD> there a way to sort the array by a hash key, eg. key "color"?

hmm, could you be the first person to ever need to sort a list of hashes
by one of its keys? i doubt it.

FAQ

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
----- Stem and Perl Development, Systems Architecture, Design and Coding ----
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org
Damian Conway Perl Classes - January 2003 -- http://www.stemsystems.com/class


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

Date: Tue, 11 Mar 2003 02:11:56 GMT
From: Joel Konkle-Parker <jjk3@msstate.edu>
Subject: Stumped on cgi...
Message-Id: <3E6D45F9.8060100@msstate.edu>

I give my server this:

----------
#!/usr/local/bin/perl

print <<'SOMETHINGELSE';
Content-type: text/plain

something
SOMETHINGELSE
----------

and my server gives me this:

----------
Can't find string terminator "SOMETHINGELSE" anywhere before EOF at 
test.cgi line 3.
----------

I'm confused...

- Joel



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

Date: Tue, 11 Mar 2003 11:19:04 +0900
From: Roy Marteen <rm@no-mail.com>
Subject: Re: Stumped on cgi...
Message-Id: <20030311111904.78bce5e4.rm@no-mail.com>

Hi Joel,

On Tue, 11 Mar 2003 02:11:56 GMT
Joel Konkle-Parker <jjk3@msstate.edu> wrote:

> I give my server this:
> 
> ----------
> #!/usr/local/bin/perl
> 
> print <<'SOMETHINGELSE';
> Content-type: text/plain
> 
> something
> SOMETHINGELSE
> ----------
> 
> and my server gives me this:
> 
> ----------
> Can't find string terminator "SOMETHINGELSE" anywhere before EOF at 
> test.cgi line 3.
> ----------

Maybe there was a whitespace after SOMETHINGELSE? 



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

Date: Tue, 11 Mar 2003 02:30:44 GMT
From: Joel Konkle-Parker <jjk3@msstate.edu>
Subject: Re: Stumped on cgi...
Message-Id: <3E6D4A63.4080609@msstate.edu>

> Maybe there was a whitespace after SOMETHINGELSE? 
> 

looks like that did it... thanks



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

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 4692
***************************************


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