[19097] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1292 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 12 14:05:42 2001

Date: Thu, 12 Jul 2001 11:05:15 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <994961114-v10-i1292@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Thu, 12 Jul 2001     Volume: 10 Number: 1292

Today's topics:
    Re: about fcntl <skilchen@swissonline.ch>
    Re: about fcntl <bart.lateur@skynet.be>
    Re: Active State <tschmelter@statesman.com>
        Another flock question (Eric Audet)
    Re: Another flock question (Tad McClellan)
    Re: argument in regular expression <leclerc.fabrice@wanadoo.fr>
        Catch errors raised within PerlIsql.pm (Pyxos)
        curious about array of filehandles (Xtreme)
    Re: curious about array of filehandles (Rafael Garcia-Suarez)
    Re: curious about array of filehandles <ren@tivoli.com>
        Deleting a line, when an string is matched; possible? <nick2408@c2i.net>
    Re: Deleting a line, when an string is matched; possibl <TGVCDPVNTLMI@spammotel.com>
        easy multi-file find & replace? <yahoo_com@francis.uy>
    Re: easy multi-file find & replace? <gnarinn@hotmail.com>
        Efficiency hit of $1 in Regexps? (Jonathan Stephen Yurek)
    Re: Efficiency hit of $1 in Regexps? (Tad McClellan)
        Error in Image::Magick <bkesuma@REMOVE.CAPITALS.yahoo.com>
    Re: Help with a Web page problem <cpryce@pryce.net>
    Re: Help with a Web page problem (dave)
        help!! - file transfer from windows (chris jackson)
    Re: help!! - file transfer from windows <simon.hughes@bluewin.ch>
    Re: How popular is Python, anyway? (was: Long Live Pyth <abraham@dina.kvl.dk>
    Re: How to resolve multi process issue??? nobull@mail.com
        name conflict with new module (based on AuthCookie) (Gururaj Upadhye)
        Parse::RecDescent: calling a parser from inside a gramm <hayati@math.uiuc.edu>
    Re: Parse::RecDescent: calling a parser from inside a g (Damian Conway)
        Problems installing DBD-Chart module (Stan Brown)
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 12 Jul 2001 15:47:48 +0200
From: "Samuel Kilchenmann" <skilchen@swissonline.ch>
Subject: Re: about fcntl
Message-Id: <9ikanb$j7972$1@ID-13368.news.dfncis.de>

"sarah" <lijinzhi@263.net> wrote in
news:9ijfr6$g8q$1@crchh14.us.nortel.com...
>
> if (open(FILEH,"test.pl")) {
>     $flag_1=fcntl(FILEH, F_GETFL, 0);
>     $ret_1=fcntl(FILEH, F_SETFL, O_RDWR);
>     $flag_2=fcntl(FILEH, F_GETFL, 0);
>
>     $ret_2=fcntl(FILEH, F_SETLK, F_RDLCK);
>     $ret_3=fcntl(FILEH, F_SETLK, F_WRLCK);
> }
>
> The value of all variables printed are:
>     $flag_1:   "0 but true"

Thats somewhat strange, but probably possible because usually O_RDONLY == 0

please note that you should do something like:
$flag_1 &= O_ACCMODE
before testing the value against O_RDONLY, O_WRONLY, O_RDWR.

>     $flag_2:   "0 but true" ( I think it should be O_RDWR, ie.3)

The only file status flags that can be changed are:
O_APPEND (not on files opened with O_RDONLY)
O_NONBLOCK
O_SYNC
O_ASYNC

please note that you should combine the wanted new flags with existing flag
bits, eg.:
$flag_1 |= O_APPEND;
$ret_1=fcntl(FILEH, F_SETFL, $flag_1);

(see W.R. Stevens' APUE p. 64 for details)

>     $ret_2 & $ret_3: undefined (I think both should be "0 but true")
>
File locking with fcntl is not as simple as that, you need to pass a packed
flock struct as 3rd argument to the fcntl call.

see W.R. Stevens' APUE chapter 12 for details.

(just in case: APUE = Advanced Programming in the Unix Environment)

modified example script:
use Fcntl;

$| = 1;

if (sysopen(FILEH,"test.pl", O_RDWR)) {
  $flag_1 = fcntl(FILEH, F_GETFL, 0)
             or warn "can't fcntl F_GETFL: $!";
  printf("flag_1: %d %d ", $flag_1, $flag_1 & O_ACCMODE);
  $result = (($flag_1 & O_ACCMODE) == O_RDWR) ? "OK": "Not OK";
  print "$result\n";

  print "setting O_APPEND flag ";
  $flag_1 |= O_APPEND;
  $ret_1 = fcntl(FILEH, F_SETFL, $flag_1)
            or warn "can't fcntl F_SETFL, O_APPEND: $!";
  print "returned: $ret_1\n";

  $flag_2 = fcntl(FILEH, F_GETFL, 0)
             or warn "can't fcntl F_GETFL: $!";
  printf("flag_2: %d %d ", $flag_2, $flag_2 & O_APPEND);
  $result = (($flag_2 & O_APPEND) == O_APPEND) ? "OK": "Not OK";
  print "$result\n";

  print "placing read lock on target file ";
  $struct_flock = set_struct_flock(F_RDLCK);
  $ret_2 = fcntl(FILEH, F_SETLK, $struct_flock)
            or warn "can't fcntl F_SETLK, F_RDLK: $!";
  print "returned: $ret_2\n";
  prompt();

  print "testing read lock on target file ";
  $ret_2 = fcntl(FILEH, F_GETLK, $struct_flock)
            or warn "can't fcntl F_GETLK, F_RDLK: $!";
  print "returned: $ret_2\n";
  display_struct_flock($struct_flock);
  prompt();

  print "releasing read lock on target file ";
  $struct_flock = set_struct_flock(F_UNLCK);
  $ret_2 = fcntl(FILEH, F_SETLK, $struct_flock)
            or warn "can't fcntl F_SETLK, F_UNLK: $!";
  print "returned: $ret_2\n";
  prompt();

  print "placing write lock on target file ";
  $struct_flock = set_struct_flock(F_WRLCK);
  $ret_3 = fcntl(FILEH, F_SETLK, $struct_flock)
            or warn "can't fcntl F_SETLK, F_WRLK: $!";
  print "returned: $ret_3\n";
  prompt();
}

sub prompt {
  print "press newline to continue ";
  my $r = <STDIN>;
  chomp($r);
  if (lc($r) eq 'q') {
    exit();
  }
}

sub set_struct_flock {
  my $type = shift;

  return pack("SSLLSS", $type, 0,0,0,0,0);
}

sub decode_struct_flock {
  my $struct_flock = shift;

  return unpack("SSLLSS", $struct_flock);
}

sub display_struct_flock {
  my $struct_flock = shift;

  my ($type, $offset, $whence, $len, $pid, $xxx) =
    decode_struct_flock($struct_flock);

  print "decoded struct flock:\n";
  print <<EOT
  Type:   $type
  Offset: $offset
  Whence: $whence
  Length: $len
  PID:    $pid
  xxx:    $xxx
EOT
}
__END__




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

Date: Thu, 12 Jul 2001 14:35:28 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: about fcntl
Message-Id: <20drktssstd4f1vbpcn3vtsh18g3biot3h@4ax.com>

sarah wrote:

>The following is a very simple example of mine:
>
>if (open(FILEH,"test.pl")) {
>    $flag_1=fcntl(FILEH, F_GETFL, 0);
>    $ret_1=fcntl(FILEH, F_SETFL, O_RDWR);
>    $flag_2=fcntl(FILEH, F_GETFL, 0);
>
>    $ret_2=fcntl(FILEH, F_SETLK, F_RDLCK);
>    $ret_3=fcntl(FILEH, F_SETLK, F_WRLCK);
>}
>
>The value of all variables printed are:
>    $flag_1:   "0 but true"
>    $flag_2:   "0 but true" ( I think it should be O_RDWR, ie.3)
>    $ret_1:   "0 but true"
>    $ret_2 & $ret_3: undefined (I think both should be "0 but true")
>
>Why the results are not what I wish?

You first open a file for read only, and then you attempt to make it
read-wite by fiddling with fcntl(). I would be very surprised if that
could ever work. So it probably doesn't.

This excerpt from fcntl(2)'s man page, see
<http://www.hgmp.mrc.ac.uk/cgi-bin/man.cgi?section=2&topic=fcntl>, goes:

    F_SETFL   Set the file status flags, defined  in  <fcntl.h>,
               for  the  file  description associated with fildes
               from the corresponding bits in the third argument,
               arg,  taken as type int. Bits corresponding to the
               file access mode and the oflag values that are set
               in  arg are ignored.

Does that answer your first question?

And the entry for "F_SETLK" says:

               Set or clear a file segment lock according to  the
               lock description pointed to by the third argument,
               arg, taken as a  pointer  to  type  struct  flock,
               defined in <fcntl.h>. 

You don't have a pointer to a "flock" structure. I wouldn't even know
how you could pass one.

-- 
	Bart.


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

Date: Thu, 12 Jul 2001 17:44:59 GMT
From: Tim Schmelter <tschmelter@statesman.com>
Subject: Re: Active State
Message-Id: <3B4DE20D.69D728F9@statesman.com>

Drew wrote:

> "Adam Stewart" <Stewy@Chartermi.net> wrote in message news:<tkoose7di0467d@corp.supernews.com>...
> > For a while now I have been interested in learning perl. So I recently
> > installed Active State Perl on my computer. My operating system is Windows
> > 98, just so you know. First thing is it says to run there example program to
> > make sure it is working correctly. Now the problem is where do I run this
> > program from? It says to type <perl example.pl> at the command line, but it
> > doesnt say where this command line is, and i've looked all over with out
> > success.
> >
> > Does anyone understand what I am saying? Your help is appreciated. Actualy I
> > would prefer for you to email me than to respond here as I may not get back
> > here for a few days.
> >
> > Thank you,
> > Stewyyyyyyyy
>
> "Command line" refers to does command prompt.  click "start" -> "run"
> -> type "command".  use the CD command to get the directory where the
> file is.  then type "perl example.pl".

I don't know about anyone else, but I actually *felt* myself lock into a generation gap reading this
thread. :-(>>>~ (Which is the emoticon for "I've got a long gr[ea]y beard", I'm going to say.)

--
Tim Schmelter
Public Key available from http://www.keyserver.net
CAD7 2ABB 05A4 2F00 4CAE 7D2F 127C 129A 7173 2951




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

Date: 12 Jul 2001 07:19:31 -0700
From: eaudet@solution123.com (Eric Audet)
Subject: Another flock question
Message-Id: <9e41e06.0107120619.59f64f78@posting.google.com>

Ok, I have a game with over 20000 players .... each players is a
unique file. Everytime, a player login or do any action, my program
open a lock file for locking purpose. ( flock(LOCKFILE,LOCK_EX);)
To unlock the file, I just close(LOCKFILE) I don't use the
flock(LOCKFILE,LOCK_UN)... I've been told that close(LOCKFILE) was
enough.

My problem is I want the LOCKFILE deleted (I have a quota on numbers
of files) ... So what should I do?

Solution 1?
open(LOCKFILE);
flock(LOCKFILE,LOCK_EX);
#DO STUFF
unlink("lockfile");
close(LOCKFILE);

OR
Solution 2?
open(LOCKFILE);
flock(LOCKFILE,LOCK_EX);
#DO STUFF
close(LOCKFILE);
unlink("lockfile");


The problem with solution 2 is that if someone else open the file
between close and unlink, the file will get deleted and everything
could get messed???

Any ideas? Help?

Eric Audet


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

Date: Thu, 12 Jul 2001 09:41:02 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Another flock question
Message-Id: <slrn9kra7e.iht.tadmc@tadmc26.august.net>

Eric Audet <eaudet@solution123.com> wrote:

>My problem is I want the LOCKFILE deleted (I have a quota on numbers
>of files) ... So what should I do?


unlink() it before you close() it.


>Solution 1?
>open(LOCKFILE);


so you have

   $LOCKFILE = 'lockfile';  

somewhere?


>flock(LOCKFILE,LOCK_EX);
>#DO STUFF
>unlink("lockfile");
>close(LOCKFILE);


You should be checking all the return values.


>The problem with solution 2 

[snip race condition]


And what is the problem with solution 1 then?


Looks OK to me with regard to deleting the lock file.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Thu, 12 Jul 2001 18:46:34 +0200
From: Fabrice Leclerc <leclerc.fabrice@wanadoo.fr>
Subject: Re: argument in regular expression
Message-Id: <leclerc.fabrice-58518A.18463412072001@persmail.uhp-nancy.fr>

In article <3B4CC82B.590A8A17@acm.org>, "John W. Krahn" 
<krahnj@acm.org> wrote:

> 
> Are you trying to find a string with the text "position:" followed by a
> number in the range 1-3000 followed by "-"?
> 
> perl -ne '$/ = "\n\n"; print if /position:(\d+)-/ and $1 >= 1 and $1 <=
> 3000;' input >> output
> 
> 
> 
> John

I just realized that it doesn't do exactly what I want. There are some 
particular cases where the pattern /position:<number>-/ appears twice or 
more in the same paragraph. Everytime it occurs, only the first pattern 
is identified and the following ones are omitted. For example, if I have 
two patterns: /position:200-/ and /position:2000-/ in this order in the 
same paragraph:

the perl command:
perl -ne '$/ = "\n\n"; print if /position:(\d+)-/ and $1 >= 200 and $1 
<= 250;' 
gives the paragraph which contains both patterns (/position:200-/ and 
/position:2000-/) 

the perl command:
perl -ne '$/ = "\n\n"; print if /position:(\d+)-/ and $1 >= 2000 and $1 
<= 2500;' 
does not give any hit.

Is there any way to fix this problem.
Thanks again for your help.
Fab.

N.B.: I use different frames for the position numbers to get a final 
output formatted as a table with the number of occurences vs the frame 
position.


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

Date: 12 Jul 2001 06:44:07 -0700
From: pyxos@fairesuivre.com (Pyxos)
Subject: Catch errors raised within PerlIsql.pm
Message-Id: <e9c5c709.0107120544.aa7db4e@posting.google.com>

Hi, 

I use PerlIsql.pm and I want to know if it is possible to catch errors
like this described below and therefore put the message in a log file
and act as it needs :

Uncaught exception from user code:
        Error: Msg 2601, Level 14, State 3:
Server 'DEV9_DS', Line 1:
Attempt to insert duplicate key row in object 'SYSTEM_PARAMETERS' with
unique index 'xsysparm_keys'
Command has been aborted.
(0 rows affected)

        PerlIsql::get_result('PerlIsql=HASH(0xc2864)') called at
PerlIsql.pm line 127
        PerlIsql::close_connection('PerlIsql=HASH(0xc2864)') called at
test_insert.pl line 23

Any ideas,

Thanks in advance


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

Date: 12 Jul 2001 07:59:23 -0700
From: lxl22@visto.com (Xtreme)
Subject: curious about array of filehandles
Message-Id: <91ff860e.0107120659.38347da5@posting.google.com>

Hi,

Lately, I had to implement a program that created a large number of
output files.  The easiest thing to do (or so I think), was to create
an array of filehandles like so:

#!/usr/bin/perl

my @fh = ();
# make array of 10 file handles
for $i (0..10) {
  local *FILE;
  open(FILE, ">output$i.txt") || die "Can't open output\n";
  push(@fh, *FILE);
}

# open them in order and print to them
for $file (@fh) {
  print $file "bla bla bla";
  close $file;
}

That works fine.  However, assuming the first loop is executed, why
can't I then, later in the program, do something like:
print $fh[$i] "bla bla bla";
for a valid value of $i?

I'm (unfortunately) using Perl for Win v5.6.1 (but I'm hoping that the
above is platform independent!)

Thanks in advance,
Xtreme


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

Date: 12 Jul 2001 15:13:49 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: curious about array of filehandles
Message-Id: <slrn9krfm8.ga3.rgarciasuarez@rafael.kazibao.net>

Xtreme wrote in comp.lang.perl.misc:
[...]
> That works fine.  However, assuming the first loop is executed, why
> can't I then, later in the program, do something like:
> print $fh[$i] "bla bla bla";
> for a valid value of $i?

This is a grammatical issue (technically, about what is called "indirect
object method calls" -- see perlobj for more). Your problem, and how to
resolve it, is described in perlfunc, section about "print". In brief :

      print { $fh[$i] } "bla bla bla";

-- 
Rafael Garcia-Suarez / http://rgarciasuarez.free.fr/


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

Date: 12 Jul 2001 11:16:29 -0500
From: Ren Maddox <ren@tivoli.com>
Subject: Re: curious about array of filehandles
Message-Id: <m3g0c2w2aq.fsf@dhcp9-161.support.tivoli.com>

On 12 Jul 2001, lxl22@visto.com wrote:

[snip]

> That works fine.  However, assuming the first loop is executed, why
> can't I then, later in the program, do something like:
> print $fh[$i] "bla bla bla";
> for a valid value of $i?

See "perldoc -f print".  In particular:

               Note that if you're storing FILEHANDLES in an
               array or other expression, you will have to use a
               block returning its value instead:

                   print { $files[$i] } "stuff\n";
                   print { $OK ? STDOUT : STDERR } "stuff\n";

HTH...
-- 
Ren Maddox
ren@tivoli.com


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

Date: Thu, 12 Jul 2001 16:26:02 GMT
From: "Nick" <nick2408@c2i.net>
Subject: Deleting a line, when an string is matched; possible?
Message-Id: <uck37.2415$em.68322@juliett.dax.net>


Guru's,

Problem is thus. Have a file that is something like this:

line1 word1 word2 word3 word4
line2  word10 word20 word30 word40
line3 word11 word21 word31 word41
line4 word1a word2a word3a word4a

well, actually, I have several hundred files like this, all in different
directories, but anyway,
what I want to do, is to find a string, for example 'word2' and when that is
found in this file,
delete the line it is found on.

perl -pi.backup -e 's|word2||' would find it, and delete the 'word2'. but
how do I delete then entire line???

So, afterwards, my file would look like this:-

line2  word10 word20 word30 word40
line3 word11 word21 word31 word41
line4 word1a word2a word3a word4a

Hope you can help.

TIA

Nick.




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

Date: Thu, 12 Jul 2001 18:41:59 +0200
From: Ronald Blaschke <TGVCDPVNTLMI@spammotel.com>
Subject: Re: Deleting a line, when an string is matched; possible?
Message-Id: <3B4DD357.1080108@spammotel.com>

How about
     perl -ni.backup -e'print unless /word2/'


Nick wrote:

> Guru's,
> 
> Problem is thus. Have a file that is something like this:
> 
> line1 word1 word2 word3 word4
> line2  word10 word20 word30 word40
> line3 word11 word21 word31 word41
> line4 word1a word2a word3a word4a
> 
> well, actually, I have several hundred files like this, all in different
> directories, but anyway,
> what I want to do, is to find a string, for example 'word2' and when that is
> found in this file,
> delete the line it is found on.
> 
> perl -pi.backup -e 's|word2||' would find it, and delete the 'word2'. but
> how do I delete then entire line???



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

Date: Thu, 12 Jul 2001 12:13:50 -0400
From: Frank Nospam <yahoo_com@francis.uy>
Subject: easy multi-file find & replace?
Message-Id: <yahoo_com-A89630.12135012072001@news.hcf.jhu.edu>

I'm sure this is in an FAQ somewhere, but I haven't found it yet.
 If someone just points me to the correct one, that would be great.

What's an easy way to do a find and replace (such as changing
 /\bfoobar/ to /fubar/) on all text files in a folder hierarchy
 (such as 'public_html' in an IRIX account)?

I'm guessing this can probably be done in about 10 characters
 (not including the strings), but I can't figure out which 10.

-F.


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

Date: Thu, 12 Jul 2001 16:27:06 +0000
From: gnari <gnarinn@hotmail.com>
Subject: Re: easy multi-file find & replace?
Message-Id: <994955226.452441444154829.gnarinn@hotmail.com>

In article <yahoo_com-A89630.12135012072001@news.hcf.jhu.edu>,
Frank Nospam  <yahoo_com@francis.uy> wrote:
>I'm sure this is in an FAQ somewhere, but I haven't found it yet.
> If someone just points me to the correct one, that would be great.
>
>What's an easy way to do a find and replace (such as changing
> /\bfoobar/ to /fubar/) on all text files in a folder hierarchy
> (such as 'public_html' in an IRIX account)?
>

do you mean (not recursive)
perl -pi.bak -e's/\bfoobar/fubar/g;' public_html/*.txt

use find to make it recursive

gnari


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

Date: Thu, 12 Jul 2001 13:49:55 +0000 (UTC)
From: jyurek@WPI.EDU (Jonathan Stephen Yurek)
Subject: Efficiency hit of $1 in Regexps?
Message-Id: <9ik9u3$1jo3$1@bigboote.WPI.EDU>

I'm writing a CGI script that has the possibility of being called quite 
often, so I'd like to keep execution time as low as possible. So I've 
tried to avoid capturing in my regexps... but it seems as though I've run 
into a place where using them would simply be much more convenient than 
trying to hack around it. I know that the addition of capturing into one 
regexp means that perl has to include capturing for all of them, but I 
don't know what kind of performace hit this means for the code. How 
(in)effiecient is the capturing mechanism?

--
Jonathan Yurek
The Happy Blues Man
http://www.wpi.edu/~jyurek/
jon@yurek.net

"Bubbles bubbles everywhere, but not a drop to drink... yet."


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

Date: Thu, 12 Jul 2001 09:11:44 -0400
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Efficiency hit of $1 in Regexps?
Message-Id: <slrn9kr8gg.ifi.tadmc@tadmc26.august.net>

Jonathan Stephen Yurek <jyurek@WPI.EDU> wrote:

>I know that the addition of capturing into one 
>regexp means that perl has to include capturing for all of them


You need to unknow that, because it is not true  :-)

There is no program-wide penalty associated with using the
dollar-digit variables. Go ahead and use them when you need them.


You are no doubt thinking of some other issue. Mentioning $', $`
or $& (maybe) slows things down. 

Mentioning $1 only slows down the pattern match that it appears in.
Other pattern matches are unaffected.


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Fri, 13 Jul 2001 00:05:04 +0900
From: Batara Kesuma <bkesuma@REMOVE.CAPITALS.yahoo.com>
Subject: Error in Image::Magick
Message-Id: <20010713000504.5e0e89ef.bkesuma@REMOVE.CAPITALS.yahoo.com>

Hi,

I tried to install PerlMagick. I downloaded it from CPAN. I am on RH 7.0.
The first time I run perl Makefile.PL, some warning about -lfreetype came
out. Then I downloaded the new freetype.rpm (the version is
freetype-2.0.1-4), and run perl Makefile.PL again. This time everything
seems ok.

[root@hades PerlMagick-5.34]# perl Makefile.PL                
Writing Makefile for Image::Magick

But when I run make, this error comes out:

[root@hades PerlMagick-5.34]# make
gcc -c -I../ -I.. -I/usr/include/freetype2 -I/usr/include/freetype2
-D_REENTRANT -D_FILE_OFFSET_BITS=64 -I/usr/local/include
-I/usr/X11R6/include -I/usr/X11R6/include/X11 -fno-strict-aliasing -O2
-march=i386 -mcpu=i686     -DVERSION=\"5.34\" -DXS_VERSION=\"5.34\" -fPIC
-I/usr/lib/perl5/5.6.0/i386-linux/CORE -DHAVE_CONFIG_H Magick.c
Magick.xs:76:24: magick/api.h: ??????????????????????
make: *** [Magick.o] $B%(%i!<(B 1

What happened? How can I fix it? Oh yes, and my ImageMagick.rpm is:
ImageMagick-5.2.2-5

Please help, and thanks so much.

--bk


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

Date: Thu, 12 Jul 2001 08:41:57 -0500
From: cp <cpryce@pryce.net>
Subject: Re: Help with a Web page problem
Message-Id: <B7731354.85B9%cpryce@pryce.net>

in article J6337.40384$J91.1928985@bgtnsc06-news.ops.worldnet.att.net,
Sector at spisholiwriter@hotmail.com wrote on 07/11/2001 3:59 PM:

> I need help with a web page problem. My page displays someone else's page on
> the left frame. I have a link on my frame that the person can click to find
> information about the other persons webpage. I have the script to get
> information about there website. I just need some code to add to my script,
> that can display the right frame's full url so my script can find the page
> on the other server. Maybe putting that URL into a scalar variable. If
> anyone can help it will be greatly appreciated.
> 
> 

Okay, I'm not trying to be a smartie-pants... (well maybe a teensy).

If it were me, and I had posted a Perl question, in a Perl news group, and I
was having trouble with a script written in Perl...

Then maybe, just maybe, I might want to post some of the code in question?

This group will help you debug code, and answer questions. The more specific
and concise you question is, the faster, and more reliable your answers will
be. 

This group will NOT, 1) read your mind, or 2) write your code for you.

If your question is more related to html or CGI (even CGI development in
Perl), your question is better off asked in another group (CGI questions are
best answered in comp.infosystems.www.authoring.cgi)

Search the previous posts in this News group at
http://groups.google.com?group=comp.lang.perl.misc

cp



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

Date: 12 Jul 2001 09:11:04 -0700
From: usted@cyberspace.org (dave)
Subject: Re: Help with a Web page problem
Message-Id: <e2c00ae.0107120811.462f8ffb@posting.google.com>

Skip all of the that and add:

<a href="whatever" target="_new"> to the link....

And he is right, this has NOTHING to do with Perl.

dave


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

Date: 12 Jul 2001 08:21:16 -0700
From: cj_usm@hotmail.com (chris jackson)
Subject: help!! - file transfer from windows
Message-Id: <b912a70e.0107120721.7735a1bf@posting.google.com>

I have written a perl script which does a file transfer between a windows
machine and a unix machine. I have hardcoded the location of the source files
like so:

$sourcefile = "G:/zzz/filetosend"

However I recently was told that the drive is logical and could be any letter.
Can anyone help me make the script more generic so that it will pick up the
data from whatever drive it is mapped to?

Rgds

Chris J


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

Date: Thu, 12 Jul 2001 18:12:25 +0200
From: "Simon Hughes" <simon.hughes@bluewin.ch>
Subject: Re: help!! - file transfer from windows
Message-Id: <3b4dccc3_5@news.bluewin.ch>

Use a UNC name for the file location:

$sourcefile = "\\\\myserver\\myshare\\zzz\\filetosend"

This way you don't need a drive mapping at all. Note the double
backslashes - under Windows the path would be just
"\\myserver\myshare\zzz\filetosend".  I'd suggest using UNC names wherever
possible, as they eliminate problems with drive letters, which are messy to
use in scripting.

"chris jackson" <cj_usm@hotmail.com> wrote in message
news:b912a70e.0107120721.7735a1bf@posting.google.com...
> I have written a perl script which does a file transfer between a windows
> machine and a unix machine. I have hardcoded the location of the source
files
> like so:
>
> $sourcefile = "G:/zzz/filetosend"
>
> However I recently was told that the drive is logical and could be any
letter.
> Can anyone help me make the script more generic so that it will pick up
the
> data from whatever drive it is mapped to?
>
> Rgds
>
> Chris J




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

Date: 12 Jul 2001 19:32:03 +0200
From: Per Abrahamsen <abraham@dina.kvl.dk>
Subject: Re: How popular is Python, anyway? (was: Long Live Python!)
Message-Id: <rjwv5evyss.fsf@ssv2.dina.kvl.dk>

[ FUT: gnu.misc.discuss ]

philh@comuno.freeserve.co.uk (phil hunt) writes:

> If you think that facts are "crap" and hard statistical analysis
> is "flamebait" then all I can say is that it is up to others to
> decide, on the basis of your posts, how "crappy" you are.

Croosposting between advocacy groups like gnu.misc.discuss and
comp.lang.java.advocacy, and technical groups like comp.lang.python,
comp.lang.c, comp.lang.perl.misc is probably not the smartest thing to
do, if one want a serious discussion.

However, the statistical data itself is worthy of discussion,
preferably in a language neutral group.  I have therefore directed
followups to gnu.misc.discuss.  I'll not respond to any crossposted
answers. 

And obvious potential problem is that the data is based on a project
count from a database with many unfinished beginner projects.  I
suspect a count of developers or lines of code would put e.g. C and
Perl higher, and Python and Java lower, as the later have a reputation
for being more beginner friendly.

With regard to the "age" analysis, the trend is that young languages
take marketshare from old languages.  Anything else would have been a
big surprise, bordering to impossible.


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

Date: 12 Jul 2001 18:04:53 +0100
From: nobull@mail.com
Subject: Re: How to resolve multi process issue???
Message-Id: <u9g0c284ei.fsf@wcl-l.bham.ac.uk>

gururaj@powertec.com (Gururaj Upadhye) writes:

> I have set this on windows NT, with mod perl 1.25. The behaviour is
> very
> unusual. The first, 3rd, 5th, (odd) access to the script result in
> user name and password prompt page to be displayed. At this point if I
> hit the browser's back button and try again, the operation is
> successful. This has puzzled me a lot and I donot have any solution
> for this. 
> 
> My guess is that one of the apache processes is responding properly
> but other one is not. I am starting Apache as a NT service. How to
> resolve this issue?

Are you perhaps relying on persistance of global variables in mod_perl
to carry session state information?

Don't.

There is no guarentee that two successive transactions handled by a
given server process will constitute part of the same session.

There is no guarentee that two successive transactions that constitute
part of the same session will be handled by a the same given server
process.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: 12 Jul 2001 07:18:40 -0700
From: gururaj@powertec.com (Gururaj Upadhye)
Subject: name conflict with new module (based on AuthCookie)
Message-Id: <23c54ab6.0107120618.d2bdfcf@posting.google.com>

I have written a module based on AuthCookie sample AuthCookieHanlder
and AuthCookieDBI. I wanted to name my module as AuthCookieTxt and
Apache fails to find the functions mentioned in the httpd.conf file. I
get following error:
[Sun Jul 08 11:37:06 2001] [error] Can't locate object method
"authenticate" via package "BASE::AuthCookieTxt"

I copied the AuthCookieTxt module on top of AuthCookieHanlder and it
worked as it is supposed to. What I am missing in my system?

Following is the extract from httpd.conf 
	PerlModule BASE::AuthCookieHandler
     <Location /docs1>
      AuthType BASE::AuthCookieHandler
      AuthName WhatEver
      PerlAuthenHandler BASE::AuthCookieHandler->authenticate
      PerlAuthzHandler BASE::AuthCookieHandler->authorize
      require valid-user
     </Location>

Thanks and regards,
-Gururaj.


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

Date: Thu, 12 Jul 2001 11:58:26 -0500
From: Katia Hayati <hayati@math.uiuc.edu>
Subject: Parse::RecDescent: calling a parser from inside a grammar
Message-Id: <Pine.GSO.4.33.0107121150130.14638-100000@u00.math.uiuc.edu>

Hello,

I have a script that uses Parse::RecDescent, in which I want to define 2
parsers. The grammar for the second parser has to call the first parser.

Here's a simplified version of my code:

====
#!/usr/local/bin/perl -w
use strict;
use Parse::RecDescent;

$::RD_ERRORS = 1;
$::RD_WARN = 1;
$::RD_HINT = 1;

$main::text_to_parse = "";

my $grammar1 = q{
[...]
}

my $parser1 = new Parse::RecDescent($grammar1);

my $grammar2 = q{
[...]

rule: TEXT
	{
	  $main::text_to_parse = $item{TEXT};
          if (defined $main::text_to_parse) { print "1\n"; }
          my $p_text = $main::parser1->startrule($main::text_to_parse);
	}

[...]

}

==========

This prints 1, and if I insert a "print $item{TEXT}" it prints what it
should, but then Parse::RecDescent says: Can't call method
"startrule" on an undefined value at (eval 47) line 1102, <IN> line 5.

I don't understand that. I think it's a scope problem, but I don't see
where it's coming from.

I would very much appreciate any help on this subject.


Thanks in advance,
-- Katia Hayati



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

Date: 12 Jul 2001 17:12:14 GMT
From: damian@cs.monash.edu.au (Damian Conway)
Subject: Re: Parse::RecDescent: calling a parser from inside a grammar
Message-Id: <9iklpe$677$1@towncrier.cc.monash.edu.au>

Katia Hayati <hayati@math.uiuc.edu> writes:

   > my $parser1 = new Parse::RecDescent($grammar1);
     ^^^^^^^^^^^

Definition of a *lexical* variable


   > rule: TEXT
   >    {
   >      $main::text_to_parse = $item{TEXT};
   >           if (defined $main::text_to_parse) { print "1\n"; }
   >           my $p_text = $main::parser1->startrule($main::text_to_parse);
                            ^^^^^^^^^^^^^^

But accessing a *package* variable.

Delete the 'my' from the definition above and it should work.

Damian


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

Date: 12 Jul 2001 09:31:21 -0400
From: stanb@panix.com (Stan Brown)
Subject: Problems installing DBD-Chart module
Message-Id: <9ik8r9$1ve$1@panix3.panix.com>

I am trying to install DBD-Chart to use with Orac, and I'm having a bit of
trouble. Here is what happens when I run "perl Makefile.PL"

Configuring DBD::Chart ...

>>>     Remember to actually *READ* the README file!
        And re-read it if you have any problems.

		Checking for DBI, 1.13 or later ... ok
		Checking for GD, 1.13 or later ... ok
		Checking for GD::Graph, 1.13 or later ... 
		You don't have the GD::Graph package version 1.13 or later,
		installed.


Look simple enough. _Except_ that I have installed GD::GRaph. Here is the
appropriate section from /opt/perl5/lib/5.6.0/PA-RISC1.1/perllocal.pod:

=head2 Thu Jul 12 08:57:26 2001: C<Module> L<GD::Graph>

=over 4

=item *

C<installed into: /opt/perl5/lib/site_perl/5.6.0>

=item *

C<LINKTYPE: dynamic>

=item *

C<VERSION: 1.33>

=item *

C<EXE_FILES: >

=back

=head2 Thu Jul 12 08:58:54 2001: C<Module> L<GD>

	Can anyone help me figure out what I am doing wrong here?

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


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