[30342] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1585 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 28 18:09:51 2008

Date: Wed, 28 May 2008 15:09:12 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 28 May 2008     Volume: 11 Number: 1585

Today's topics:
    Re: automatic callback for leaving a sub-routine <devnull4711@web.de>
    Re: automatic callback for leaving a sub-routine <FBergemann@web.de>
    Re: automatic callback for leaving a sub-routine <devnull4711@web.de>
    Re: automatic callback for leaving a sub-routine <ben@morrow.me.uk>
    Re: Perldoc recommendation <dragnet\_@_/internalysis.com>
    Re: Perldoc recommendation <g@e.nvalid>
    Re: Perldoc recommendation <jurgenex@hotmail.com>
    Re: Perldoc recommendation <e@g.ivalid>
    Re: Remove a tab with backspace? <achimpeters@gmx.de>
    Re: Remove a tab with backspace? <bugbear@trim_papermule.co.uk_trim>
    Re: Remove a tab with backspace? valerie.seigneur@googlemail.com
    Re: Remove a tab with backspace? <devnull4711@web.de>
    Re: Remove a tab with backspace? <szrRE@szromanMO.comVE>
    Re: Remove a tab with backspace? <1usa@llenroc.ude.invalid>
    Re: Remove a tab with backspace? <1usa@llenroc.ude.invalid>
        Turning a dir output into a webpage ?? <mdcarlile@googlemail.com>
    Re: Turning a dir output into a webpage ?? <1usa@llenroc.ude.invalid>
        Using COM in Perl... Possible? rgamble@gmail.com
    Re: Using COM in Perl... Possible? <mark.clementsREMOVETHIS@wanadoo.fr>
    Re: Using COM in Perl... Possible? <ben@morrow.me.uk>
    Re: Using perl locally on a Windows XP system <1usa@llenroc.ude.invalid>
        Variable remaining undef in one place but not another. <justin.0805@purestblue.com>
    Re: Variable remaining undef in one place but not anoth <jimsgibson@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Wed, 28 May 2008 19:10:51 +0200
From: Frank Seitz <devnull4711@web.de>
Subject: Re: automatic callback for leaving a sub-routine
Message-Id: <6a5i16F35n6sjU1@mid.individual.net>

Frank Bergemann wrote:
> 
> i would like to automatically call a nested sub-routine A_exit(...)
> for leaving sub-routine A(...).
> In concrete to take care about "clean-up" for early exits.
> OK, i could try to do w/o early exits (pls. don't start a
> "philosophic" discussion about that :-)
> 
> In C++ i can use some RAII classes instead to take care about
> automatic clean-up.
> I don't know, if something like that is possible in perl as well(?) -
> because here we use garbage collector.
> 
> I tried to use some local END { ... }.
> But that didn't work as expected.
> It was just invoked ( in addition to my global END { ...} ) at end of
> program.
> 
> Is there a way to force a call-back invocation for leaving a sub-
> routine?

I think the following code does what you want:

sub A {
    ...
    my $obj = Cleanup->new(...);
    ...
    return; # <- automatic call of $obj->DESTROY()
}

package Cleanup;

sub new {
    ...
}

sub DESTROY
    my $self = shift;
    # put cleanup code here
}

Frank
-- 
Dipl.-Inform. Frank Seitz; http://www.fseitz.de/
Anwendungen für Ihr Internet und Intranet
Tel: 04103/180301; Fax: -02; Industriestr. 31, 22880 Wedel


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

Date: Wed, 28 May 2008 10:33:32 -0700 (PDT)
From: Frank Bergemann <FBergemann@web.de>
Subject: Re: automatic callback for leaving a sub-routine
Message-Id: <8373aa9b-5e9a-4b4e-9556-db8c615e3f37@8g2000hse.googlegroups.com>

Hi Frank,

On 28 Mai, 19:10, Frank Seitz <devnull4...@web.de> wrote:
> Frank Bergemann wrote:
>
>
> I think the following code does what you want:
>
> sub A {
>     ...
>     my $obj =3D Cleanup->new(...);
>     ...
>     return; # <- automatic call of $obj->DESTROY()
>
> }

Does that _immediately_ invoke the destructor of 'Cleanup' on exit of
sub A?
Or is it up to the garbage collector _when_ actually the d'tor is
invoked?
In my case i need to reset alarm(0) :-(

rgds
Frank

>
> package Cleanup;
>
> sub new {
>     ...
>
> }
>
> sub DESTROY
>     my $self =3D shift;
>     # put cleanup code here
>
> }
>
> Frank
> --
> Dipl.-Inform. Frank Seitz;http://www.fseitz.de/
> Anwendungen f=FCr Ihr Internet und Intranet
> Tel: 04103/180301; Fax: -02; Industriestr. 31, 22880 Wedel



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

Date: Wed, 28 May 2008 19:48:40 +0200
From: Frank Seitz <devnull4711@web.de>
Subject: Re: automatic callback for leaving a sub-routine
Message-Id: <6a5k83F35n6sjU3@mid.individual.net>

Frank Bergemann wrote:
> On 28 Mai, 19:10, Frank Seitz <devnull4...@web.de> wrote:
>>
>>I think the following code does what you want:
>>
>>sub A {
>>    ...
>>    my $obj = Cleanup->new(...);
>>    ...
>>    return; # <- automatic call of $obj->DESTROY()
>>}
> 
> 
> Does that _immediately_ invoke the destructor of 'Cleanup' on exit of
> sub A?

Yes.

> Or is it up to the garbage collector _when_ actually the d'tor is
> invoked?

Perl has a reference count driven garbage collection, i.e.
the destructor is immediately called when the reference count
goes to zero.

> In my case i need to reset alarm(0) :-(

Hm. Try it :)

Frank
-- 
Dipl.-Inform. Frank Seitz; http://www.fseitz.de/
Anwendungen für Ihr Internet und Intranet
Tel: 04103/180301; Fax: -02; Industriestr. 31, 22880 Wedel


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

Date: Wed, 28 May 2008 21:30:49 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: automatic callback for leaving a sub-routine
Message-Id: <p0s0h5-r8l1.ln1@osiris.mauzo.dyndns.org>


Quoth Frank Seitz <devnull4711@web.de>:
> Frank Bergemann wrote:
> > 
> > i would like to automatically call a nested sub-routine A_exit(...)
> > for leaving sub-routine A(...).
> 
> I think the following code does what you want:
> 
> sub A {
>     ...
>     my $obj = Cleanup->new(...);
>     ...
>     return; # <- automatic call of $obj->DESTROY()
> }
> 
> package Cleanup;
> 
> sub new {
>     ...
> }
> 
> sub DESTROY
>     my $self = shift;
>     # put cleanup code here
> }

Or you can use AtExit, which has already been written for you:

    use AtExit;

    sub A {
        my $raii = AtExit->new(sub {
            # cleanup here
        });
    }

Ben

-- 
   Razors pain you / Rivers are damp
   Acids stain you / And drugs cause cramp.                    [Dorothy Parker]
Guns aren't lawful / Nooses give
  Gas smells awful / You might as well live.                   ben@morrow.me.uk


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

Date: Wed, 28 May 2008 13:15:22 -0500
From: Marc Bissonnette <dragnet\_@_/internalysis.com>
Subject: Re: Perldoc recommendation
Message-Id: <Xns9AAC9103DBB98dragnetinternalysisc@216.196.97.131>

"A. Sinan Unur" <1usa@llenroc.ude.invalid> fell face-first on the keyboard. 
This was the result: news:Xns9AAC4D778A13Easu1cornelledu@127.0.0.1:

> Marc Bissonnette <dragnet\_@_/internalysis.com> wrote in
> news:Xns9AABC7E394129dragnetinternalysisc@216.196.97.131: 
> 
>> Jürgen Exner <jurgenex@hotmail.com> fell face-first on the keyboard.
>> This was the result: news:b3em3493oqdc765a223qvce7fi9em5r6vq@4ax.com: 
>> 
>>> Marc Bissonnette <dragnet\_@_/internalysis.com> wrote:
>>>> Sadly, my machine here is Windows Vista (Yes, I know - boneheaded)
>>>>... Microsoft decided brilliantly (!!!) to make the DOS box only
>>>>open in a narrow window - For someone who's eyesight isn't what it
>>>>used to be, this doesn't make for great long content reading :( 
>>> 
>>> May Vista be good or bad, it always amuses me how people love to
>>> participate in Microsoft bashing using arguments that tell more about
>>> their (lack of) intelligence than about the Microsoft product in
>>> question:
> 
> ...
> 
>> Well, as mean-spirited as that response was - it was correct and I
>> have indeed learned something new - for that, thank you. 
> 
> It is not mean spiritied to point out the stupidity of someone who is 
> accusing others of the same. 
> 
> Those three exclamation points next to "brilliantly" in your original 
> post means you thought Microsoft's design decision was stupid when in 
> reality it was your own ignorance and willingness to blame other people 
> for the same that was the reason for your issues.
> 
>> What you *got* out of being a crotchety old fart in that <shrug> Hope
>> it makes you feel the bigger person.
> 
> Hope it makes you feel like a bigger person to put down other people's 
> work.

Shows what you know. Ever tried running Vista with both current and legacy 
(less than 10 years) games ? BSOD, AppCrashes galore, driver 
incompatibilities with MBs, Video cards, network cards, etc. 




-- 
Marc Bissonnette
Looking for a new ISP? http://www.canadianisp.com
Largest ISP comparison site across Canada.


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

Date: Wed, 28 May 2008 13:00:06 -0700
From: "Gordon Etly" <g@e.nvalid>
Subject: Re: Perldoc recommendation
Message-Id: <6a5ru9F367ls2U1@mid.individual.net>

A. Sinan Unur wrote:
> Marc Bissonnette <dragnet\_@_/internalysis.com> wrote in
> > Jürgen Exner <jurgenex@hotmail.com> fell face-first on the keyboard.
> > > Marc Bissonnette <dragnet\_@_/internalysis.com> wrote:

> > > > Sadly, my machine here is Windows Vista (Yes, I know - 
> > > > boneheaded)
> > > > ... Microsoft decided brilliantly (!!!) to make the DOS box only
> > > > open in a narrow window - For someone who's eyesight isn't what 
> > > > it
> > > > used to be, this doesn't make for great long content reading :(

> > > May Vista be good or bad, it always amuses me how people love to
> > > participate in Microsoft bashing using arguments that tell more
> > > about their (lack of) intelligence than about the Microsoft 
> > > product
> > > in question:

> ...

> > Well, as mean-spirited as that response was - it was correct and I
> > have indeed learned something new - for that, thank you.

> It is not mean spiritied to point out the stupidity of someone who is
> accusing others of the same.

What are you talking about? Did you even read Jürgen's post (part of 
which is quoted above? He implied that anyone who says anything negative 
about Vista is of low intelligence. If that's not mean spirited, I don't 
know what is. The fact is Vista is chalk full of problems and I would 
wager that people who blindly accept Vista might need themselves to be 
evaluated.


> Those three exclamation points next to "brilliantly" in your original
> post means you thought Microsoft's design decision was stupid when in
> reality it was your own ignorance and willingness to blame other
> people for the same that was the reason for your issues.

While I agree he probably did not have it setup right, when it comes to 
Vista, it can be quite frustrating to do many things that were otherwise 
simple in previous versions of Windows. Many things have yet to be fixed 
(even with SP1.) Hardware problems a plenty and many software 
incompatibilities remain, so I find it hard to blame someone getting 
frustrated and temporarily going brain numb.


> > What you *got* out of being a crotchety old fart in that <shrug> 
> > Hope
> > it makes you feel the bigger person.

> Hope it makes you feel like a bigger person to put down other people's
> work.

But it's ok for Jürgen to do just that, but not someone else?



-- 
G.Etly 




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

Date: Wed, 28 May 2008 20:19:57 GMT
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Perldoc recommendation
Message-Id: <5ker34d0jndadfo8kil129l2fa50aqnjcs@4ax.com>

"Gordon Etly" <g@e.nvalid> wrote:
>A. Sinan Unur wrote:
>> Marc Bissonnette <dragnet\_@_/internalysis.com> wrote in
>> > Jürgen Exner <jurgenex@hotmail.com> fell face-first on the keyboard.
>> > > Marc Bissonnette <dragnet\_@_/internalysis.com> wrote:
>
>> > > > Sadly, my machine here is Windows Vista (Yes, I know - 
>> > > > boneheaded)
>> > > > ... Microsoft decided brilliantly (!!!) to make the DOS box only
>> > > > open in a narrow window - For someone who's eyesight isn't what 
>> > > > it
>> > > > used to be, this doesn't make for great long content reading :(
>
>> > > May Vista be good or bad, it always amuses me how people love to
>> > > participate in Microsoft bashing using arguments that tell more
>> > > about their (lack of) intelligence than about the Microsoft 
>> > > product
>> > > in question:
>
>> ...
>
>> > Well, as mean-spirited as that response was - it was correct and I
>> > have indeed learned something new - for that, thank you.
>
>> It is not mean spiritied to point out the stupidity of someone who is
>> accusing others of the same.
>
>What are you talking about? Did you even read Jürgen's post (part of 
>which is quoted above? He implied that anyone who says anything negative 
>about Vista is of low intelligence.

Really? You must be reading something different than I have been
writing.
And no, I don't see anything wrong with questioning someone's
intelligence if he is blaming a company for allegedly not providing
feature X when this person used this very feature X before in an earlier
product and it works exactly the same in the new product as it did in
the old product.

> If that's not mean spirited, I don't 
>know what is. 

We know that you don't know much.

Back you go to where you crawled out from. 
	Author: Gordon Etly <get@bentsys.com>
	Author: Gordon Etly <getly@bentsys-INVALID.com>
	Author: Gordon Etly <g.etly@bent-INVALID-sys.com>
	Author: Gordon Etly <g.etly@bentsys.INVALID.com>
	Author: Gordon Etly <.@.invalid>
	Author: Gordon Etly <g@e.nvalid> 
You may want to consult a professional about your severe case of split
personalities.

jue


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

Date: Wed, 28 May 2008 14:44:03 -0700
From: "Gordon Etly" <e@g.ivalid>
Subject: Re: Perldoc recommendation
Message-Id: <6a6214F36ioe0U1@mid.individual.net>

Jürgen Exner wrote:
> "Gordon Etly" <g@e.nvalid> wrote:
> > A. Sinan Unur wrote:
> > > Marc Bissonnette <dragnet\_@_/internalysis.com> wrote in
> > > > Jürgen Exner <jurgenex@hotmail.com> fell face-first on the
> > > > keyboard.
> > > > > Marc Bissonnette <dragnet\_@_/internalysis.com> wrote:

 ...

> > > > > May Vista be good or bad, it always amuses me how people love 
> > > > > to
> > > > > participate in Microsoft bashing using arguments that tell 
> > > > > more
> > > > > about their (lack of) intelligence than about the Microsoft
> > > > > product in question:

> > > ...

> > > > Well, as mean-spirited as that response was - it was correct and 
> > > > I
> > > > have indeed learned something new - for that, thank you.

> > > It is not mean spiritied to point out the stupidity of someone who
> > > is accusing others of the same.

> > What are you talking about? Did you even read Jürgen's post (part of
> > which is quoted above? He implied that anyone who says anything
> > negative about Vista is of low intelligence.

> Really? You must be reading something different than I have been
> writing.

Then re-read your own words:
" how people love to participate in Microsoft "
" bashing using arguments that tell moreabout "
" their (lack of) intelligence "

That whole paragraph (quoted in full further above) shows how little you 
know about Windows Vista, and serves as an insult to the person you were 
replying to.


> And no, I don't see anything wrong with questioning someone's
> intelligence if he is blaming a company for allegedly not providing
> feature X when this person used this very feature X before in an
> earlier product and it works exactly the same in the new product as
> it did in the old product.


In general, I would agree. However, in Vista, things have a knack for 
breaking down and doing strange things when least expect it. Having 
serviced a couple hundred Vista machines (among many others) for over a 
year now or so, I've seen many completely inexplicable happenings that 
just had no reason for being, so please don't pretend Vista is this 
perfect shining example of quality engineering.


> You may want to consult a professional about your severe case of split
> personalities.

You must be confused, I only post under this name.


-- 
G.Etly 




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

Date: Wed, 28 May 2008 17:38:36 +0200
From: Achim Peters <achimpeters@gmx.de>
Subject: Re: Remove a tab with backspace?
Message-Id: <483D7C7C.90308@gmx.de>

valerie.seigneur@googlemail.com schrieb:
> I'd like to use "\b" to delete a tab character, 

Whether it does or not depends on the terminal you print the tab and the 
\b to. And other than possibly on the output device the tab is not 
deleted anywhere, if at all.

> perl -e 'print "AB\bC\n";'
> works fine and prints "AC", but
> perl -e 'print "A\t\bC\n";'
> prints "A-tab-C".

Are you sure? I'd expect
"A-(n-1 spaces)-C"
where n is the number of spaces the tab was converted to.

> This is the simplified version, of course. In my script the extra tab
> is there because I'm printing a tab each time I go through a loop, but
> at the last iteration, I actually want a new line there, so I want to
> get rid of the tab character and replace it with "\n".

Wrong approach. Don't print the last tab in the first place.

BTW: You can see on your terminal, whether a line has a tab before the 
\n or not? To me "abc\t\n" and "abc\n" look alike when printed: Nothing 
to be seen in that line after the "abc" up until the right border of the 
screen or window.

Bye
  Achim




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

Date: Wed, 28 May 2008 16:54:48 +0100
From: bugbear <bugbear@trim_papermule.co.uk_trim>
Subject: Re: Remove a tab with backspace?
Message-Id: <JaednVjMT7DUHaDVnZ2dnUVZ8szinZ2d@posted.plusnet>

valerie.seigneur@googlemail.com wrote:
> Hi,
> 
> I'd like to use "\b" to delete a tab character

Backspace is often an editing command to
terminals. No more, no less.

It does not (itself) perform editing.

Further, having a backspace in a string
can be VERY confusing if you output the string
to a terminal, since the preceding character
may be overwritten ON THE TERMINAL.

Howevere, the preceding character is still
in the string, which may well be two characters
longer (as shown by length()) than you
expect.

   BugBear


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

Date: Wed, 28 May 2008 10:15:48 -0700 (PDT)
From: valerie.seigneur@googlemail.com
Subject: Re: Remove a tab with backspace?
Message-Id: <e009726b-7079-4380-b6df-9664d881c469@56g2000hsm.googlegroups.com>

So how could I do what I describe above? I used to gather the output
of a whole line in a string and then use s/\t$/\n/ to change the last
tab to a newline,
but that sort of seems cumbersome. Are there any other ways to do it?
TIMTOWTDI? I still consider myself a beginner, so sometimes it's hard
to see the possible alternatives ;-)

Val.


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

Date: Wed, 28 May 2008 19:20:17 +0200
From: Frank Seitz <devnull4711@web.de>
Subject: Re: Remove a tab with backspace?
Message-Id: <6a5iitF35n6sjU2@mid.individual.net>

valerie.seigneur@googlemail.com wrote:
> So how could I do what I describe above? I used to gather the output
> of a whole line in a string and then use s/\t$/\n/ to change the last
> tab to a newline,
> but that sort of seems cumbersome. Are there any other ways to do it?

perldoc -f chop

Frank
-- 
Dipl.-Inform. Frank Seitz; http://www.fseitz.de/
Anwendungen für Ihr Internet und Intranet
Tel: 04103/180301; Fax: -02; Industriestr. 31, 22880 Wedel


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

Date: Wed, 28 May 2008 11:19:10 -0700
From: "szr" <szrRE@szromanMO.comVE>
Subject: Re: Remove a tab with backspace?
Message-Id: <g1k7mu01avv@news4.newsguy.com>

bugbear wrote:
> valerie.seigneur@googlemail.com wrote:
>> Hi,
>>
>> I'd like to use "\b" to delete a tab character
>
> Backspace is often an editing command to
> terminals. No more, no less.
>
> It does not (itself) perform editing.
>
> Further, having a backspace in a string
> can be VERY confusing if you output the string
> to a terminal, since the preceding character
> may be overwritten ON THE TERMINAL.
>
> Howevere, the preceding character is still
> in the string, which may well be two characters
> longer (as shown by length()) than you
> expect.

One way around that is something like:

   my $newstr = $str; 1 while($newstr =~ s![^\b][\b]!!);

That will remove any character that comes directly behind a \b character 
(as well as the \b itself) which prints as expected and length() returns 
the correct length.

To also nuke leading \b's, use this instead:

   my $newstr = $str; 1 while($newstr =~ s!(?:[^\b]|^)[\b]!!);

-- 
szr 




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

Date: Wed, 28 May 2008 21:27:04 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Remove a tab with backspace?
Message-Id: <Xns9AACB183C9299asu1cornelledu@127.0.0.1>

valerie.seigneur@googlemail.com wrote in news:e009726b-7079-4380-b6df-
9664d881c469@56g2000hsm.googlegroups.com:

> So how could I do 

You can start by reading the posting guidelines for this group and 
actually following them.

> what I describe above?

What do you mean 'above'?

Sinan

-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/


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

Date: Wed, 28 May 2008 21:31:14 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Remove a tab with backspace?
Message-Id: <Xns9AACB23879953asu1cornelledu@127.0.0.1>

valerie.seigneur@googlemail.com wrote in news:a95c5c49-148c-4a6a-891c-
85e7c4f7c27a@d45g2000hsc.googlegroups.com:

> In my script the extra tab
> is there because I'm printing a tab each time I go through a loop, but
> at the last iteration, I actually want a new line there, so I want to
> get rid of the tab character and replace it with "\n".

That's just silly.
 
> Is this a problem with my perl code or with Apple's X11?

s/perl/Perl/

As a rule, I find it much more productive assume any trouble I am having 
with programming is due to errors on my part rather than, say, the 
language, the library, the OS and what not.

Please read the posting guidelines, post a short but complete script 
illustrating the nature and scale of your problem.

Sinan

-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/


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

Date: Wed, 28 May 2008 10:05:42 -0700 (PDT)
From: mdcarlile <mdcarlile@googlemail.com>
Subject: Turning a dir output into a webpage ??
Message-Id: <0d5cf532-77ce-4bff-93b3-9e8d0d67fd73@f36g2000hsa.googlegroups.com>

Hiya

I have a quick question:  is it possible to turn a dir query (windose
command line) into a webpage automatically.
Here's what I want to do:
I want to automatically run a script that will output the directory
listing and then output a .html page with the directory listing and
the links constructed.
Is this possible in perl??  I have been unsuccessful using c.
Any pointers would be great, as I have challenged myself to do this.
Cheers
Mark


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

Date: Wed, 28 May 2008 21:24:28 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Turning a dir output into a webpage ??
Message-Id: <Xns9AACB11357029asu1cornelledu@127.0.0.1>

mdcarlile <mdcarlile@googlemail.com> wrote in news:0d5cf532-77ce-4bff-
93b3-9e8d0d67fd73@f36g2000hsa.googlegroups.com:

> I want to automatically run a script that will output the directory
> listing and then output a .html page with the directory listing and
> the links constructed.

OK. Give it a shot.

> Is this possible in perl??

Of course it is.

>  I have been unsuccessful using c.

s/c/C/

I don't see much of a chance of you succeeding in solving this problem 
in Perl either (I am assuming you know C and do not know Perl, otherwise 
the inclusion of the statement above does not make any sense).

> Any pointers would be great, as I have challenged myself to do this.

It looks to me like you are on the market for free fish without admiting 
such.

The method, regardless of language is trivial:

* Read the list of all files in a location.

* For each file in list, create an HTML link.

* Of course, surround the whole thing with the appropriate HTML.

I would recommend using HTML::Template.

Sinan

-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/


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

Date: Wed, 28 May 2008 13:09:35 -0700 (PDT)
From: rgamble@gmail.com
Subject: Using COM in Perl... Possible?
Message-Id: <33864e50-3602-4907-a006-452a6a1be3f3@w7g2000hsa.googlegroups.com>

Greetings all,

I've been tasked where I work to create an HTML interface that
combines a data export step with a send to an Oracle database step.
Our non-HTML code is all written in Perl, and the various data export
functions use a COM model.

My basic question is, can Perl call COM objects?

A bit more specifically, if I have a line in VBscript like:

Set EvApp = CreateObject("EchoviewCom.EvApplication")

which opens a program called Echoview,

can I do the same thing in Perl, and then use the various COM objects
and methods associated with EvApp?

Thanks,
Robert


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

Date: Wed, 28 May 2008 20:27:43 +0000
From: Mark Clements <mark.clementsREMOVETHIS@wanadoo.fr>
Subject: Re: Using COM in Perl... Possible?
Message-Id: <483dc03f$0$903$ba4acef3@news.orange.fr>

rgamble@gmail.com wrote:
> Greetings all,
> 
> I've been tasked where I work to create an HTML interface that
> combines a data export step with a send to an Oracle database step.
> Our non-HTML code is all written in Perl, and the various data export
> functions use a COM model.
> 
> My basic question is, can Perl call COM objects?
> 
> A bit more specifically, if I have a line in VBscript like:
> 
> Set EvApp = CreateObject("EchoviewCom.EvApplication")
> 
> which opens a program called Echoview,
> 
> can I do the same thing in Perl, and then use the various COM objects
> and methods associated with EvApp?

You want to look at Win32::OLE.

search.cpan.org

Mark


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

Date: Wed, 28 May 2008 21:32:06 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Using COM in Perl... Possible?
Message-Id: <63s0h5-r8l1.ln1@osiris.mauzo.dyndns.org>


Quoth rgamble@gmail.com:
> 
> I've been tasked where I work to create an HTML interface that
> combines a data export step with a send to an Oracle database step.
> Our non-HTML code is all written in Perl, and the various data export
> functions use a COM model.
> 
> My basic question is, can Perl call COM objects?

You can under Win32, by using Win32::OLE. AFAIK you can't call (MS) COM
under other operating systems.

Ben

-- 
For the last month, a large number of PSNs in the Arpa[Inter-]net have been
reporting symptoms of congestion ... These reports have been accompanied by an
increasing number of user complaints ... As of June,... the Arpanet contained
47 nodes and 63 links. [ftp://rtfm.mit.edu/pub/arpaprob.txt] * ben@morrow.me.uk


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

Date: Wed, 28 May 2008 21:33:31 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Using perl locally on a Windows XP system
Message-Id: <Xns9AACB29C5B12Aasu1cornelledu@127.0.0.1>

Bill H <bill@ts1000.us> wrote in news:6ab8640b-5582-4edf-b1db-
f38fa99b1cc5@e53g2000hsa.googlegroups.com:

> This is not particullary a perl question but applies. 

No it does not.

> I do all my perl development

s/perl/Perl/

> interfaces. What I would like to do is setup the XP system so I can
> run the perl locally. For example, with the flash programs I write you
> are not allowed to cross domains, so the flash file must reside on the
> same system as the perl (cgi) that it communicates with. Since this is
> the case I can not run these flash files within the developer and have
> all the debugging features.

So, you are asking how to set up and configure a webserver on your 
system. That does not have anything to do with Perl.

> I am sure there are a number of you
> who have already set their system to do this.

Of course. And, it is trivial to do so.

Sinan
-- 
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)

comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/


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

Date: Wed, 28 May 2008 14:58:53 -0000
From: Justin C <justin.0805@purestblue.com>
Subject: Variable remaining undef in one place but not another.
Message-Id: <4157.483d732d.4ce8a@zem>

I have a perl program which generates a web-page. It is supposed to pass
the cwd on to part that starts the HTML, so that the cwd can be used in
the HTML title tag. It doesn't. My logs tell me it is undefined.
However, when I pass it on to another program it is defined. I'm sure
I'm just not seeing the wood for the trees... either that, or perl is
running ahead of itself and not getting an answer to the "getPage()"
subroutine.


#!/usr/bin/perl

use warnings;
use strict;
use CGI qw/:standard/;
use CGI::Carp qw/fatalsToBrowser/;

my $page = getPage();
htmlStart();
LeftNav();

sub getPage{
    my $rv = `../docs/getCwd.pl`;
    return $rv;
}
sub htmlStart{
    my @args = ("../docs/htmlStart.pl", $page);
    system(@args);
}
sub LeftNav{
    my @args = ("../docs/navLeft.pl", $page);
    system(@args);
}

----
Here is getCwd.pl:

#!/usr/bin/perl

use warnings;
use strict;
use Cwd;

my $path = (cwd() =~ /^\/+.*\/(.*)$/);# get just the last part of the path
print "$1";

----
Here is htmlStart.pl:

#!/usr/bin/perl
use warnings;
use strict;
use CGI qw/:standard/;
use CGI::Carp qw/fatalsToBrowser/;

my $page = pop @ARGV;

#	Define the page title
my $title = "Masons Music - $page";

#	Start the html document
print header;
print start_html(
    -title=>$title,
    -style=>{'src'=>'/docs/style.css'},
);

----
Here is navLeft.pl, where $page is passed successfully, and doesn't
throw up and undef warning:

#!/usr/bin/perl
use warnings;
use strict;

my @links = qw/contact about sales news/;
my $page = pop @ARGV;

foreach ( @SiteLinks::sequence ) {
    firstPart($_);
}

sub firstPart{
    if ( $page eq (pop @links) ) {
        print " class=\"thisPage2\"";
			}
}


----

Sorry there isn't less code, but I couldn't find a way of demonstrating
the problem with fewer lines. 

As you can see, $page is passed to both of the external programs, yet in
the first it's passed to it remains undef while the second (and third,
for there is another I've not shown here) gets the value.

Any ideas what's going on? I have reduced the code above for conciseness, 
I hope it's not now beyond understanding.

I thank you for any help you can give with this.

	Justin.

-- 
Justin C, by the sea.


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

Date: Wed, 28 May 2008 09:36:02 -0700
From: Jim Gibson <jimsgibson@gmail.com>
Subject: Re: Variable remaining undef in one place but not another.
Message-Id: <280520080936029421%jimsgibson@gmail.com>

In article <4157.483d732d.4ce8a@zem>, Justin C
<justin.0805@purestblue.com> wrote:

> I have a perl program which generates a web-page. It is supposed to pass
> the cwd on to part that starts the HTML, so that the cwd can be used in
> the HTML title tag. It doesn't. My logs tell me it is undefined.
> However, when I pass it on to another program it is defined. I'm sure
> I'm just not seeing the wood for the trees... either that, or perl is
> running ahead of itself and not getting an answer to the "getPage()"
> subroutine.
> 
> 
> #!/usr/bin/perl
> 
> use warnings;
> use strict;
> use CGI qw/:standard/;
> use CGI::Carp qw/fatalsToBrowser/;
> 
> my $page = getPage();
> htmlStart();
> LeftNav();
> 
> sub getPage{
>     my $rv = `../docs/getCwd.pl`;
>     return $rv;
> }
> sub htmlStart{
>     my @args = ("../docs/htmlStart.pl", $page);
>     system(@args);
> }
> sub LeftNav{
>     my @args = ("../docs/navLeft.pl", $page);
>     system(@args);
> }
> 
> ----
> Here is getCwd.pl:
> 
> #!/usr/bin/perl
> 
> use warnings;
> use strict;
> use Cwd;
> 
> my $path = (cwd() =~ /^\/+.*\/(.*)$/);# get just the last part of the path
> print "$1";

You should check to see if the regular expression matches before using
the capture buffer. Something like:

if( $path =~ /...(.*)$/ ) {
  print $1;
}else{
  print "No match";
}

-- 
Jim Gibson


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

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.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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 V11 Issue 1585
***************************************


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