[22706] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4927 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri May 2 14:07:30 2003

Date: Fri, 2 May 2003 11:05:07 -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           Fri, 2 May 2003     Volume: 10 Number: 4927

Today's topics:
    Re: CPAN Solaris problem <goedicke@goedsole.com>
    Re: Hep serving Gif please <spamsucks@noemail.com>
        locating module NetCDF <ben_altman@deadspam.com>
        Moving a file with overwrite confirmation? (Mark Smith)
    Re: Moving a file with overwrite confirmation? <ian@WINDOZEdigiserv.net>
        Outlook (was Re: Newbie Problem: Cannot see result of . <cwilbur@mithril.chromatico.net>
    Re: Outrage (was Re: Newbie Problem: Cannot see result  <you.gotta@be.kidding.com>
        Perl Mozilla LDAP search of MS Exchange GAL, listing Co <cingram@pjocsNOSPAMORHAM.demon.co.uk>
        regex negating a search/word <lance-news@augustmail.com>
    Re: regex negating a search/word (Hunter Johnson)
    Re: regex negating a search/word (Michael Jensen)
    Re: regex with /\G .. /gc foobear@nospam.zoom.net
    Re: regex with /\G .. /gc foobear@nospam.zoom.net
    Re: search, replace and insert. <w.koenig@acm.org>
    Re: Sending output to 2 frames? <shah@typhoon.xnet.com>
    Re: Subtracting strings [long post] (Anno Siegel)
    Re: Subtracting strings [long post] (Anno Siegel)
    Re: Using system("xx") to call a binary.  How to answer <jurgenex@hotmail.com>
    Re: Using system("xx") to call a binary.  How to answer (Michael Jensen)
    Re: waste of time (Sara)
    Re: waste of time (Malcolm Dew-Jones)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 02 May 2003 13:20:13 GMT
From: William Goedicke <goedicke@goedsole.com>
Subject: Re: CPAN Solaris problem
Message-Id: <m3ade5iiyh.fsf@mail.goedsole.com>

Dear Y"all - 

I <goedicke@goedsole.com> wrote:

> I'm having a problem using CPAN as follows:
> 
> Testing if you have a C compiler
> cc   -c  test.c
> /usr/ucb/cc:  language optional software package not installed
> *** Error code 1
> make: Fatal error: Command failed for target `test.o'

It gets more interesting.  Doing:

cpan> install Graph::Reader

Merrily calls gcc for XML::Parser... and everything works fine.  Try
and install DateTime in the same session and I get the error above.

That seems all wrong.

     Yours -      Billy

============================================================
     William Goedicke     goedicke@goedsole.com            
                          http://www.goedsole.com:8080      
============================================================

          Lest we forget:

Finesse not force.

		- William Goedicke


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

Date: Fri, 02 May 2003 14:58:38 GMT
From: "Topspin" <spamsucks@noemail.com>
Subject: Re: Hep serving Gif please
Message-Id: <wIvsa.2165$q_6.1501@news.randori.com>

"Topspin" <spamsucks@noemail.com> wrote in message
news:0Htsa.1927$q_6.325@news.randori.com...

[snipped]

> open (CODE, "$file.gif") || &notfound;
> print "Content-type: image/gif\n\n";
> binmode CODE;
> print <CODE>;
> close (CODE);
> exit;
>

I couldn't find it documented anywhere, but I finally resolved my problem.
The following fixed it...
open (CODE, "$file.gif") || &notfound;
print "Content-type: image/gif\n\n";
binmode STDOUT;
binmode CODE;
print <CODE>;
close (CODE);
exit;

As a side note... I found lots of posts and docs that mentioned using
binmode, but real-world examples were all but non-existant and being
somewhat new to Perl, I found that very frustrating.  I'm posting the
solution to my problem above because I noticed that several people had
posted similar questions.  Hopefully future seekers will find this helpful.

-PN

--
Probably the earliest flyswatters were nothing more than some
sort of striking surface attached to the end of a long stick.
- Jack Handy
---------------------------------------------------------------------------




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

Date: Fri, 02 May 2003 11:04:56 -0500
From: Ben <ben_altman@deadspam.com>
Subject: locating module NetCDF
Message-Id: <b8u4v8$dhj8q$1@ID-121117.news.dfncis.de>

Hi,

I am trying to take a perl script from HP-UX to Linux where the Linux 
system should (in theory) already be setup to handle this. When I run 
the script I get an error "Can't locate loadable object for module 
NetCDF in @INC". I did a perldoc perlvar and added a "use lib 
/path_to_library" line there but still got the same error. The directory 
listing of the path I added contains NetCDF.pm which I presume is what 
it is looking for so I am scratching my head trying to figure out what 
to do next. Any suggestions?

Thanks,
Ben



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

Date: 2 May 2003 08:36:00 -0700
From: Mark.Smith@sonyericsson.com (Mark Smith)
Subject: Moving a file with overwrite confirmation?
Message-Id: <cf24885e.0305020736.fa92f4f@posting.google.com>

I'm trying to write a perl script under Windows 2000 to move a file
from one location to another, and to ask for confirmation before
overwriting if the file already exists at the destination.

Originally I just used a system call from DOS to "move/-Y" but it
seems confirmation doesn't work when moving files between drives if
networked, it only seems to work between local disks.

I looked at the File::Copy move command, but that doesn't seem to
allow for confirmation.  I've now run out of ideas and was wondering
if anyone could help.

Regards,

    Mark.


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

Date: Fri, 02 May 2003 16:16:40 GMT
From: "Ian.H [dS]" <ian@WINDOZEdigiserv.net>
Subject: Re: Moving a file with overwrite confirmation?
Message-Id: <k965bv8sihjll6idu05jt01gep4u3nmuqf@4ax.com>
Keywords: Remove WINDOZE to reply

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

In a fit of excitement on 2 May 2003 08:36:00 -0700,
Mark.Smith@sonyericsson.com (Mark Smith) managed to scribble:

> I'm trying to write a perl script under Windows 2000 to move a file
> from one location to another, and to ask for confirmation before
> overwriting if the file already exists at the destination.
> 
> Originally I just used a system call from DOS to "move/-Y" but it
> seems confirmation doesn't work when moving files between drives if
> networked, it only seems to work between local disks.
> 
> I looked at the File::Copy move command, but that doesn't seem to
> allow for confirmation.  I've now run out of ideas and was
> wondering if anyone could help.
> 
> Regards,
> 
>     Mark.


if (-e $file) {
  # file exists
  # Prompt for confirmation
} else {
  # file doesn't exist
  # Copy file without prompt
}



Regards,

  Ian

-----BEGIN xxx SIGNATURE-----
Version: PGP 8.0

iQA/AwUBPrKZfGfqtj251CDhEQIthACghvCrjCS09u4tQBiHGJdYTvah/3cAoKyY
yK9+ljpOLd+fgDp0/Jz8JKjU
=CbpH
-----END PGP SIGNATURE-----

-- 
Ian.H  [Design & Development]
digiServ Network - Web solutions
www.digiserv.net  |  irc.digiserv.net  |  forum.digiserv.net
Scripting, Web design, development & hosting.


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

Date: Fri, 02 May 2003 14:14:02 GMT
From: Charlton Wilbur <cwilbur@mithril.chromatico.net>
Subject: Outlook (was Re: Newbie Problem: Cannot see result of .pl)
Message-Id: <87n0i5xwxb.fsf_-_@mithril.chromatico.net>

Michael Eric Battle <you.gotta@be.kidding.com> writes:

> Are you telling me that Outrage does not _require_ 
> one to top post & quote the entire message?
> 
> I've never seen anyone do anything else with it,
> even in less-than-tolerant froups like n.a.n-a.e,
> where they're regularly larted for such behavior.

Outlook does not require top-posting any more than rn or Gnus does.
But it presents the message in such a way that top-posting seems the
logical thing to do.  In addition, in the pointy-haired-boss corporate
world, top-posting is the convention, perhaps encouraged by Outlook
rich-text *mail*, which makes it *very* difficult to bottom-post, to
trim quoted text without screwing up the formatting, or to interpolate
text in reply.

My suspicion is that the correspondence of Outlook to top-posting is
because of Outlook's approach towards mail, and that anyone with
enough Usenet experience to know about the bottom-posting convention
and care to adhere to it will find another newsreader in frustration.
Alternately, if it's easier to force Outlook's news components to do
the right thing, we may just never notice the bottom-posters using
Outlook because we never think to look.

Charlton


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

Date: Fri, 02 May 2003 09:35:37 -0700
From: Michael Eric Battle <you.gotta@be.kidding.com>
Subject: Re: Outrage (was Re: Newbie Problem: Cannot see result of .pl)
Message-Id: <3EB29E59.B7F2733@be.kidding.com>

Charlton Wilbur wrote:
> Michael Eric Battle <you.gotta@be.kidding.com> writes:
> 
> > Are you telling me that Outrage does not _require_
> > one to top post & quote the entire message?
> >
> > I've never seen anyone do anything else with it,

> Outlook does not require top-posting any more than rn or Gnus does.

Had me fooled...

> ...Outlook rich-text *mail*, which makes it *very* difficult 
> to bottom-post, to trim quoted text without screwing up the 
> formatting, or to interpolate text in reply.

I guess that's what I've been calling "html mail".  In Netscrape 
it renders in an almost unreadably tiny font, with a blue line 
down the left margin.  Attempted interpolation into the middle 
of it is quite painful.  I've seen lots of that, hence my 
suspicion that Outrage forces top posting.

> My suspicion is that the correspondence of Outlook to top-posting is
> because of Outlook's approach towards mail, and that anyone with
> enough Usenet experience to know about the bottom-posting convention
> and care to adhere to it will find another newsreader in frustration.

I like that.  That's a good working hypothesis:  "Anyone who 
gets a clue abandons Outrage for a _real_ mail/news client". 
Yeah.  (Readers please note: _I_ am about ready to abandon 
NetScrape for a _real_ mail/news client.)

What I find incomprehensible is how a PHB will "standardize", 
over the howling protests of his IT staff, on the braindead 
Imperial "software" (because _he_'s comfortable only with 
Outrage, because it's all he knows, because it came with his 
executive laptop), then bear down on those same techies (whose 
professional judgment he totally discounted the week before) 
to "fix it" when he gets infected by malware.

I am not alone in this opinion:

"And one of the things that always mystifies me is how anybody 
in corporate America will run Outlook.  I mean to say that, "they 
don't have a security story," is being very charitable.  I mean, 
it's a petri dish. Opening a piece of e-mail in Outlook is really 
asking for it."
-- [Dr] James Gosling

MikEB


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

Date: Fri, 2 May 2003 16:19:50 +0100
From: "Clyde Ingram" <cingram@pjocsNOSPAMORHAM.demon.co.uk>
Subject: Perl Mozilla LDAP search of MS Exchange GAL, listing Containers?
Message-Id: <b8u29l$rsq$1$8300dec7@news.demon.co.uk>

Here is my problem, adapting a Solaris2.6-based Perl program, which uses
Mozilla LDAP to add/delete/modify/list user and structure (Org Unit) entries
in an X.500 Directory, to apply the same Org Unit structure and user entry
content to an M$ Exchange 5.5 GAL.

(clpm is my preferred NG for Perl queries, but I welcome any suggestions of
other NGs more suited for this specifically LDAP/GAL problem.  I guessed
microsoft.public.exchange.development might be a plausible target NG, but
have seen no responses yet since posting several hours ago.)

The application will synchronise a selected Custom Recipients Container with
an (X.500) database.

The selected Custom Recipients Container (e.g.: cn=Research Recipients)
contains a hierarchy of more Recipients Containers (e.g. cn=Winchester).
And at any level in the hierarchy, Containers may contain several Custom
Recipients.  For example:

    o=ACME
            ou=Development
                    cn=Research Recipients  # Container
                            cn=Tom                 # Custom Recipient

                            cn=Winchester       # Container
                                    cn=Fred         # Custom Recipient
                                    cn=Bill           # Custom Recipient
                                    cn=Harry       # Custom Recipient

At the moment, I perform an LDAP "search" on complete subtree below the
selected Custom Recipients Container (cn=Research Recipients), filtering on
"objectClass=*".

Now this successfully lists all attributes of all Custom Recipients - their
attributes include:

    objectClass = Remote-Address & person & Top

And each has a "distinguishedName" attribute, which shows where in the
Container hiearchy they live.  e.g.

        cn=Tom, cn=Research Recipients, ou=Development, o=ACME
        cn=Fred, cn=Winchester, Research Recipients, ou=Development, o=ACME
        cn=Bill, cn=Winchester, Research Recipients, ou=Development, o=ACME
        cn=Harry, cn=Winchester, Research Recipients, ou=Development, o=ACME

Great.  But the search omits any entries for the Containers themselves.  I
mean, there is no entry with "DistinguishedName" of:

        cn=Winchester, Research Recipients, ou=Development, o=ACME

That is a pity, because I sometimes need to use LDAP to list the Container
hiearchy, without listing the users they contain.  Indeed, if I am forced to
deduce the existance of a Container simply because its name is a component
of the "distinguishedName" attribute of a Custom Recipient, then, by
definition, my application will never know of the existance of empty
Containers, or even a complete subtree of Containers which have no
sub-ordinate Custom Recipients.

Why does my LDAP search filter of "objectClass=*" omit sub-ordinate
Containers?
Why does an alternative LDAP search filter of "cn=*" omit sub-ordinate
Containers?  (It still lists only Custom Recipients, event though the
distinguished name of both type of object starts with "cn=".)

Ultimately, my application will use LDAP to remotely manage any selected
Custom Recipients Container in several ways:

1. List a complete subtree of Containers.
2. Delete selected Custom Recipients.
3. Delete selected subtree of Containers (those no longer superior to Custom
Recipients)
4. Add a new subtree of Containers.
5. Add new Custom Recipients to surviving or newly-created Containers.

I have made all of this work with an X.500 Directory, using Mozilla LDAP
from Perl on Solaris2.6 .
So I am happy about the logic of comparing, deleting, and adding structure
(OrganizationalUnits in X.500) and users.  My master plan is to make the
Exchange GAL toe the line by slaving it to my master application on Solaris.

But making this work in the Exchange 5.5 GAL depends critically on whether
LDAP lets me:

1. search
2. add
3. delete

containers, independently form the Custom Recipients that they might
contain.
Are GAL Containers simply not objects that LDAP can search, add, or delete?

I would appreciate any constructive advice on a suitable "search" filter to
nail down those Containers.

Thank-you,
Clyde Ingram





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

Date: Fri, 02 May 2003 09:29:56 -0500
From: Lance Hoffmeyer <lance-news@augustmail.com>
Subject: regex negating a search/word
Message-Id: <CK6dnUM8RdxwHS-jXTWcqA@august.net>

Hello,

Given the following regex:

$file2 =~ /TABLE\s+70.*?TELEVISION.*?(\d{1,3}\.\d)\D+/s;$P33A23 = $1


I want a way to have the search fail or to stop the search if it
finds "TABLE 71".

Any ideas how I might accomplish this?

Lance



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

Date: 2 May 2003 15:27:04 GMT
From: jhunterj@lexis-nexis.com (Hunter Johnson)
Subject: Re: regex negating a search/word
Message-Id: <b8u2o8$nmo$1@mailgate2.lexis-nexis.com>

In article <CK6dnUM8RdxwHS-jXTWcqA@august.net>,
Lance Hoffmeyer  <lance-news@augustmail.com> wrote:
> Hello,
> 
> Given the following regex:
> 
> $file2 =~ /TABLE\s+70.*?TELEVISION.*?(\d{1,3}\.\d)\D+/s;$P33A23 = $1
> 
> 
> I want a way to have the search fail or to stop the search if it
> finds "TABLE 71".
> 
> Any ideas how I might accomplish this?

Check index($file2, "TABLE 71") before doing the regex, or use a
zero-width negative look-ahead assertion by inserting (?!.*TABLE 71)
at the beginning of your match pattern.

perldoc perlre

You'll probably only want to assign to $P33A23 if the match succeeded,
though.

Hunter
--
J. Hunter Johnson        | "A little consistent wholesome modeling and
jhunterj@lexis-nexis.com |   costly servanthood are worth millions of
(937) 865-6800 x55385    |    true words harshly spoken."
Lexis-Nexis, Dayton, OH  |                               -- Ron Sider





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

Date: 2 May 2003 10:40:15 -0700
From: michael.jensen@dnp-services.com (Michael Jensen)
Subject: Re: regex negating a search/word
Message-Id: <11b834e8.0305020940.3e032a96@posting.google.com>

Lance Hoffmeyer <lance-news@augustmail.com> wrote in message news:<CK6dnUM8RdxwHS-jXTWcqA@august.net>...
> Hello,
> 
> Given the following regex:
> 
> $file2 =~ /TABLE\s+70.*?TELEVISION.*?(\d{1,3}\.\d)\D+/s;$P33A23 = $1
> 
> 
> I want a way to have the search fail or to stop the search if it
> finds "TABLE 71".
> 
> Any ideas how I might accomplish this?
> 
> Lance


Try a sentinel, for example like this:

   my $stopit;
   my $file2;
   my $P33A23;
   my @files = <TABLE*>; # or whatever it is ...

   while (defined($file2 = shift(@files)) && !$stopit) {
   	if ( $file2 =~ /TABLE\s+71/ ) {
   		$stopit = 1;
   	} else {
   		print($file2 . "\n");	# just for testing purposes
   		$file2 =~ /TABLE\s+70.*?TELEVISION.*?(\d{1,3}\.\d)\D+/s;
		$P33A23 = $1;
	}
   }

If the numerical "stopping" value is just greater than 70 (and not
necessarily exactly 71), then use the following if-clause instead:

	if ( ($file2 =~ /TABLE\s+(\d\d)/) && $1 > 70 ) {
		$stopit = 1;
	}


Regards,

   [mj]


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

Date: Fri, 02 May 2003 15:53:36 GMT
From: foobear@nospam.zoom.net
Subject: Re: regex with /\G .. /gc
Message-Id: <4wwsa.81$m53.7617@petpeeve.ziplink.net>

Malcolm Dew-Jones <yf110@vtn1.victoria.tc.ca> wrote:
> 	m/^hello/ starts looking at the start of the string, and the word
> hello must be the very first thing it finds.

> 	m/\Ghello/ starts looking where it left of last time, and the word
> hello must be the very first thing it finds.  (That description may not be
> 100% correct).


> If you say m/\GHello/gc then the H in Hello has to be the very next letter
> after the last match.


Hello Malcom and all,

I think I understand, and now see my error.

When I had my regex use \G like this. It would always fail finding
my key, value pairs with the 2nd regex.  (But it works ok without it)

LOOP: {
	$h{id} = $1,            redo if /\G^(S\d+)/gc;
	$h{$1} = $2,            redo if /\G(\S+)(?<!NOTES):\s([^,\s]+),?\s+/g
	$h{notes}{$1} = $2,     redo if /"([^"]+)"\s+"([^"]*)"/gc;
}

If I understand you correctly when using \G, the regex starts matching
exactly where it left off and my pattern has to match the next character
it scans

I had ommited a trailing space in my first regex so without it the
regex started matching on a \s and not a \S, thus failing  Adding a
space at the end of my first regex makes \G on the 2nd regex work now
(If I understood you correctly)

	$h{id} = $1,            redo if /\G^(S\d+)\s+/gc;
						  ^^^	
Does it make sense for me to use \G here then? I only want to scan the
string once. I can acheive that with /gc alone, no?  Also is using a
block with redo the proper way?  (I would use a while loop but I'm not
certain the order the items will appear in)

Finally on the 2nd regex you added a ,? at the end.  Is that really
necessary it's always going to succeed anyways no?

Thank you for your help.


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

Date: Fri, 02 May 2003 16:12:55 GMT
From: foobear@nospam.zoom.net
Subject: Re: regex with /\G .. /gc
Message-Id: <bOwsa.82$m53.7618@petpeeve.ziplink.net>

Steven Kuo <skuo@mtwhitney.nsc.com> wrote:
> On Thu, 1 May 2003 foobear@nospam.zoom.net wrote:
> (snipped) ...
>> 
>> I need to scan many thousands of strings like this very often, so
>> I thought at using \G would be efficient since I don't have to start 
>> scanning from the beginning of the string again.  I must be using 
>> it wrong though because when I add it to the beginning of my regex 
>> I don't match anything. (its ommited in my examples below to show
>> a working example that outputs what I want).
>> 
>> Is there a more efficient way of doing this perhaps? There is an 
>> example in perldoc perlop  that demonstrates what I have in mind,
>> search for 'lex-like'
[snipped]

> my %h;
> $_ =    'S89 Key: 255.255.255.255:319510, NAS: 1.1.1.1, NAS-Port: 666,
>         User-Name: foo@bar.baz, Time: 94:35:09, GSL 1,
>         NOTES: "Acct-Session-Id" "0048939656", "FooNote" "1.2.3.4",
>         "BarNote" "whee"';
>
> substr($_,0,0) = 'id: ';
>
> LOOP:
> {
>     # With some extra print statements for debugging thrown in:
>     $h{$1} = $2, redo LOOP if m#\G(\S+)(?<!NOTES):\s([^,\s]+),?\s+(?{print pos,$/;})#gc;
>     print "Begin again at ", pos , "\n";
>     $h{'notes'}{$1} = $2, redo LOOP if m/"([^"]+)"\s+"([^"]*)"/g;
> }
[snipped]

Hi Steve,

The use of substr is clever to achieve the matches with one pattern :)

I am curious, is there a way to solve this without using a zero-width
negative lookbehind assertion. (?<!pattern) I dont think some tools
support that. (and older versions of perl)

-v



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

Date: Fri, 02 May 2003 07:44:54 +0200
From: Winfried Koenig <w.koenig@acm.org>
Subject: Re: search, replace and insert.
Message-Id: <3EB205D6.8090803@acm.org>

Kurtis D. Rader wrote:
> On Wed, 30 Apr 2003 11:48:46 +0200, Winfried Koenig wrote:
> 
>>the perlrun description of option -0 may be not valid for all
>>environments.  The code point 0x1ff describes a legal character.
>>
>>code    01FF
>>name    LATIN SMALL LETTER O WITH STROKE AND ACUTE block Latin Extended-B
>>script  Latin
> 
> 
> From the perl v5.8.0 perlrun man page:
> 
>   The special value 00 will cause Perl to slurp files in paragraph
>   mode.  The value 0777 will cause Perl to slurp files whole because
>   there is no legal character with that value.
> 
> I'll grant that I don't run Perl on anything but UNIX and have very little
> experience with non-ISO-8859 character sets (i.e., CJKV Unicode), and have
> yet to write a perl program that deals with utf-8 encoding. What systems do
> not honor the -0 switch? Under which conditions does -0777 not result in
> the entire file being read as a single "line"? If there are such exceptions
> then I'd certainly encourage you to submit changes to the perlrun man page.

sorry, for confusing. Searching on google I found this patch for one of
the next perl versions:

---------
  The special value 00 will cause Perl to slurp files in paragraph mode.
  The value 0777 will cause Perl to slurp files whole because there is no
-legal character with that value.
+legal byte with that value.
+
+If you want to specify any Unicode character, use the hexadecimal
+format: C<-0xHHH...>, where the C<H> are valid hexadecimal digits.
+(This means that you cannot use the C<-x> with a directory name that
+consists of hexadecimal digits.)
----------

With this modification the option -0777 will cause slurp mode
and -0x1FF specifies the Unicode character.

Winfried Koenig


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

Date: Fri, 2 May 2003 15:39:13 +0000 (UTC)
From: Hemant Shah <shah@typhoon.xnet.com>
Subject: Re: Sending output to 2 frames?
Message-Id: <b8u3f0$34b$1@flood.xnet.com>

While stranded on information super highway Norbert Schmidt wrote:
:)Hello Hemant,
:)
:)>   I have a html page with 2 frames. When someone clicks on a button
:)>   in frame 1 my Javascript function performs some checks and calls a perl 
:)>   CGI script. 
:)
:)>   From the perl script if I find some problems I want to send the output to
:)>   frame 2 so that the frame 1 does not get wiped out. If everything is
:)>   O.K. then I want to redirect frame 1 to another html document.
:)
:)the easiest solution seems to me that you call the script with "frame 2" as
:)target.
:)
:)When everything is ok, your script should generate a blank page with just
:)some Javascript code (OnLoad handler) that reloads "frame 1".
:)
:)This approach has the additional benefit of clearing the error frame.

 Thank you very much. That worked as advertised :-)


:)
:)
:)Regards, Norbert

-- 
Hemant Shah                           /"\  ASCII ribbon campaign
E-mail: NoJunkMailshah@xnet.com       \ /  --------------------- 
                                       X     against HTML mail
TO REPLY, REMOVE NoJunkMail           / \      and postings      
FROM MY E-MAIL ADDRESS.           
-----------------[DO NOT SEND UNSOLICITED BULK E-MAIL]------------------
I haven't lost my mind,                Above opinions are mine only.
it's backed up on tape somewhere.      Others can have their own.


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

Date: 2 May 2003 13:16:55 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Subtracting strings [long post]
Message-Id: <b8tr47$9hb$1@mamenchi.zrz.TU-Berlin.DE>

Jay Tilton <tiltonj@erols.com> wrote in comp.lang.perl.misc:
> quantum_mechanic_1964@yahoo.com (Quantum Mechanic) wrote:
> : tiltonj@erols.com (Jay Tilton) wrote in message
> news:<3eaf647b.568817771@news.erols.com>...
> : > quantum_mechanic_1964@yahoo.com (Quantum Mechanic) wrote:
> : > :
> : > : [snip] ...The 2nd string must be a
> : > : proper substring of the 1st -- if there are characters in the 2nd
> : > : string not in the 1st, or there is an excess of one or more characters
> : > : in the 2nd string compared to the 1st, a failing result is returned.
> : > 
> : > That's not the usual interpretation of "substring," but the
> : > explanation is clear enough.
> : 
> : Sorry. "Subset" doesn't fit very well either. "Sub-anagram"?
> 
> I can never think of an adequate name for it either, so I deliberately
> neglected to suggest one.  :)

Hypogram

Anno


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

Date: 2 May 2003 13:28:01 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Subtracting strings [long post]
Message-Id: <b8trp1$9hb$2@mamenchi.zrz.TU-Berlin.DE>

Quantum Mechanic <quantum_mechanic_1964@yahoo.com> wrote in comp.lang.perl.misc:
> tiltonj@erols.com (Jay Tilton) wrote in message

[...]

> >         for my $i (1, -1) {
> >             $seen{$_} += $i for $foo[$i] =~ /./g;
> >         }
> 
> Nice one. 
> 
> Small critique...The RE here will be slower than split, won't it?
> [Don't use the RE engine when a built-in already exists.]
> 
>               $seen{$_} += $i for split //, $foo[$i];

Well, split() uses the regex mechanism as well, as a look at its first
parameter shows.  Benchmarks show no siginificant difference, though
split is a tad slower.

Anno


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

Date: Fri, 02 May 2003 13:51:59 GMT
From: "Jürgen Exner" <jurgenex@hotmail.com>
Subject: Re: Using system("xx") to call a binary.  How to answer its prompt with y or n?
Message-Id: <3Kusa.13981$Tb.5822@nwrddc02.gnilink.net>

John wrote:
> My Perl program runs from a command line prompt (on Windows, using
> Active Perl).  I am using system() to call another program (binary)
> that prompts for y/n. ('y' is always the proper reply.)
>
> Is there a way to get my Perl script to reply to the prompt (so I
> don't have to) and just keep on running?

You may want to look at the Expect module

jue




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

Date: 2 May 2003 10:14:45 -0700
From: michael.jensen@dnp-services.com (Michael Jensen)
Subject: Re: Using system("xx") to call a binary.  How to answer its prompt with y or n?
Message-Id: <11b834e8.0305020914.6bac0f4d@posting.google.com>

"John" <SeeMessageBody@nospam.com> wrote in message news:<MYosa.49880$ey1.4619019@newsread1.prod.itd.earthlink.net>...
> ...
> Is there a way to get my Perl script to reply to the prompt (so I don't have
> to) and just keep on running?

There are many ways, in fact.  If you need detailed control over STDIN
and STDOUT of the spawned program you might want to look at the
open2() function in module IPC::Open2.  If you also need control over
STDERR, look at open3() in IPC::Open3.

If you just need a quick fix, though, try the following:

   my $command = "whatever you want to run";
   my $answers = "answers.txt";

   # write the expected answers to a file
   open( ANSWERFILE, ">$answers" )
	or die ( "Could not open $answers:\n$!" );
   print( ANSWERFILE "Y\n" );
   close( ANSWERFILE );

   # now run the command with the ready-made answers
   system( "$command <$answers" );

If your $command requires more than one answer, $answers needs more
than one line, of course.

Regards,
  [mj]


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

Date: 2 May 2003 06:24:36 -0700
From: genericax@hotmail.com (Sara)
Subject: Re: waste of time
Message-Id: <776e0325.0305020524.6b4e752a@posting.google.com>

smugbuster@hotmail.com (smugbuster) wrote in message news:<677cff64.0304300948.7e8878c4@posting.google.com>...
> your little newsgroup or whatever you call it is a waste of time for
> anybody trying to learn anything new.
> 
Yes exactly we call it "our little newsgroup". Just the other day I
was saying to Uri= "Hey Uri, our little newsgroup..."

> legitimate questions are disparaged, ridiculed, and made fun of.
> what's wrong with you people? you were all newbies once!
We have something wrong with us indeed. This is likely the most
helpful, responsive group of contributors of all the groups. Tell ya
what- run this experiment. Dream up an generic newbie question and
post it to the linux, python, perl, and java groups and look at the
results. Chances are you'll get NOTHING from most groups, flamed by
the linux types, and "remanded" here to go to the docs.

> 
> my guess is that half of you don't know what you're talking about
> anyway.
> 
Well the other third of us sure do buddy!

> don't you have anything better to do than to get online and "flame"
> people that may not have as much knowledge of the subject as you.
> pathetic.
> 
Yes that's our little lot in life. We've dedicated ourselves to the
"Perlista Church of the Eternal Flame".

> i suggest you get a life. you're all a little too smug for your own
> good.
OK, I'll see what I can find.


> 
> oh, also, i guess i'm not cool because i don't have a witty quip at
> the end of my message, or use case sensitive words or end plural words
> with a string of "z's."
> 

Agreed.. I won't use "Washington DC" or 
'Birds of a Feather' . 'zzz';

> jack

-Sara


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

Date: 2 May 2003 09:47:36 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: waste of time
Message-Id: <3eb2a128@news.victoria.tc.ca>

smugbuster (smugbuster@hotmail.com) wrote:
: jack

So why did anybody respond?  (Apologies to anyone named Jack).


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

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


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