[17870] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 30 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Jan 10 09:25:39 2001

Date: Wed, 10 Jan 2001 06:25:20 -0800 (PST)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <979136719-v10-i30@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 10 Jan 2001     Volume: 10 Number: 30

Today's topics:
        Make fails <mstrong@zeta.org.au>
    Re: Mime parser <bart.lateur@skynet.be>
    Re: Mysterious Perl problem <krahnj@acm.org>
    Re: PERL  MP3 <ubl@schaffhausen.de>
    Re: please help me!! (Michael P. Soulier)
    Re: Problem w/ hash of references to hashes (or maybe s (Damian James)
        problems perl odbc SQL-Server 7.0: no records with tiny <claudio.militello@infos.es>
    Re: problems perl odbc SQL-Server 7.0: no records with  <jhelman@wsb.com>
    Re: regular expression for csv, but different <news@#nospam#althepal.com>
    Re: system() method won't change directories! (Eric Bohlman)
    Re: system() method won't change directories! (Eric Bohlman)
    Re: system() method won't change directories! (Reto Hersiczky)
    Re: Taking control (Rafael Garcia-Suarez)
    Re: Untaint the following string. <news@#nospam#althepal.com>
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Wed, 10 Jan 2001 23:06:22 +1100
From: Mark Strong <mstrong@zeta.org.au>
Subject: Make fails
Message-Id: <3A5C503E.5A71275C@zeta.org.au>

Trying to install a newish perl (5.6) on a debian linux 2.2.1 system, I
get a blow up when its trying to compile the dynaloader

see below
-----------------------------------------
        Making DynaLoader (static)
Processing hints file hints/linux.pl
Writing Makefile for DynaLoader
make[1]: Entering directory `/home/mstrong/perl-5.6.0/ext/DynaLoader'
mkdir ../../lib/auto/DynaLoader
make[1]: Leaving directory `/home/mstrong/perl-5.6.0/ext/DynaLoader'
make[1]: Entering directory `/home/mstrong/perl-5.6.0/ext/DynaLoader'
 ../../miniperl -I../../lib -I../../lib -I../../lib -I../../lib
DynaLoader_pm.PL DynaLoader.pm
 ../../miniperl -I../../lib -I../../lib -I../../lib -I../../lib
XSLoader_pm.PL XSLoader.pm
cp XSLoader.pm ../../lib/XSLoader.pm
cp DynaLoader.pm ../../lib/DynaLoader.pm
AutoSplitting ../../lib/DynaLoader.pm (../../lib/auto/DynaLoader)
rm -f DynaLoader.xs
cp dl_dlopen.xs DynaLoader.xs
 ../../miniperl -I../../lib -I../../lib ../../lib/ExtUtils/xsubpp
-noprototypes -typemap ../../lib/ExtUtils/typemap DynaLoader.xs >
DynaLoader.xsc && mv DynaLoader.xsc DynaLoader.c
cc -c  -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64
-O2     -DVERSION=\"1.04\" -DXS_VERSION=\"1.04\"  -I../.. -DPERL_CORE
-DLIBC="/lib/libc-2.1.3.so" DynaLoader.c
rm -rf ../../lib/auto/DynaLoader/DynaLoader.a
/usr/bin/ar cr ../../lib/auto/DynaLoader/DynaLoader.a DynaLoader.o && :
 ../../lib/auto/DynaLoader/DynaLoader.a
chmod 755 ../../lib/auto/DynaLoader/DynaLoader.a
make[1]: Leaving directory `/home/mstrong/perl-5.6.0/ext/DynaLoader'
cc  -L/usr/local/lib -rdynamic -o perl perlmain.o
lib/auto/DynaLoader/DynaLoader.a  libperl.a `cat ext.libs` -lnsl -lndbm
-ldb -ldl -lm -lc -lposix -lcrypt
/usr/lib/libdl.a(dlsym.o): In function `doit.2':
dlsym.o(.text+0x22): undefined reference to `_dl_default_scope'
dlsym.o(.text+0x4c): undefined reference to `_dl_default_scope'
make: *** [perl] Error 1

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

Anyone have any idea what's wrong (some sort of library problem, but
which one, is it something I haven't included, or an incompatible
version).

Regards
Mark Strong

mstrong@zeta.org.au




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

Date: Wed, 10 Jan 2001 07:30:06 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Mime parser
Message-Id: <os3o5t0drfs2c8tlp5dj7nb130ed8uqqug@4ax.com>

Manny wrote:

>I am tryign to decode a mime message from /var/mail files suing GBARR's
>modules.  With this module I can read a message body but the mime tags and html
>tags also comes with the body. 

You can EXTRACT the different parts. It won't change the original.

-- 
	Bart.


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

Date: Wed, 10 Jan 2001 05:10:30 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: Mysterious Perl problem
Message-Id: <3A5BEF87.7E7B5F35@acm.org>

jos_hunter_9@my-deja.com wrote:
> 
> I work on Windows NT (service pack 4).
> Server is IIS. And use oraperl to talk to Oracle7.0 database.
> The Perl interpreter arbitrarily crashes when certain links or buttons
> in the application are clicked.

> It seems that on Unix platforms I don't see this problem.

> Any thoughts will be appreciated.

The obvious solution is to run it on a Unix platform.


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

Date: Wed, 10 Jan 2001 11:03:23 +0100
From: Malte Ubl <ubl@schaffhausen.de>
Subject: Re: PERL  MP3
Message-Id: <3A5C336A.8334F1B1@schaffhausen.de>

En|gMaBoM schrieb:
> 
> I have started a project called PERLP3. I want to know if there is an Mp3 or
> sound module I could use with perl. I tryed looking at the docs, there was
> non, is this virgin ground im on?

Search for mp3 on CPAN.

->malte


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

Date: 10 Jan 2001 13:45:14 GMT
From: msoulier@nortelnetworks.com (Michael P. Soulier)
Subject: Re: please help me!!
Message-Id: <93hp1a$4sf$1@bmerhc5e.ca.nortel.com>

In article <e6O66.8$Mx3.8106@vic.nntp.telstra.net>, Wyzelli wrote:

>> http://localhost/count.pl
>>
>> and the script works!!!!
>>
>
>How about changing the line to be <!--#include virtual="count.pl" -->
>and rename your script .pl and see what happens.

    An include virtual is going to put the code from count.pl into the page,
is it not? I think this person is after either an exec cgi, or exec cmd. If
you're using a relative path to the counter, exec cmd should work. If you're
using the cgi path (ie. you have a script alias of /cgi-bin, then if you use
exec cgi, your path should be /cgi-bin/count.pl. 

    Reading up on the web server docs would help. 

    Mike

-- 
Michael P. Soulier, TD12, SKY  Tel: 613-765-4699 (ESN: 39-54699)
Optical Networks, Nortel Networks, SDE Pegasus
"...the word HACK is used as a verb to indicate a massive amount
of nerd-like effort."  -Harley Hahn, A Student's Guide to UNIX
Nortel Linux User's Group Ottawa: (internal) http://nlug.ca.nortel.com


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

Date: 10 Jan 2001 05:10:07 GMT
From: damian@puma.qimr.edu.au (Damian James)
Subject: Re: Problem w/ hash of references to hashes (or maybe scoping?)
Message-Id: <slrn95nrng.d3p.damian@puma.qimr.edu.au>

Weston Cann wrote:
[snip]
>The only two things I can think of are that 1) I'm doing the
>referencing/dereferencing wrong or 2) I have a scoping problem
>so that the data I think I'm referencing is actually getting
>scrapped before I look at it.

No, you are doing these things correctly, but see below.

>#!/usr/bin/perl

#!/usr/bin/perl -w
use strict;

Failure to make use of these error checking options can cause your posts
to this newsgroup to be ignored. Note that your program doesn't even
compile under strictures:

% perl your_program filename label
Global symbol "$filename" requires explicit package name at help_tmp line 4.
Global symbol "$label" requires explicit package name at help_tmp line 5.
Global symbol "$str" requires explicit package name at help_tmp line 8.
Global symbol "%fileHash" requires explicit package name at help_tmp line 12.
Execution of your_program aborted due to compilation errors.

I think the problem here is with your regexs:

> if($line =~ m/^###@\s*(.*?)$/)

Didn't you say you wanted to match entries in the file starting
with "#@"? The above matches lines starting with "###@".

Without strictures or warnings:

%cat filename
###@ blah
the entry for blah

%perl your_program filename blah
fetchKey: |filename| |blah|


Fetched Key:
the entry for blah
End Fetched Key

__END

 ...where your_program contains your existing code. This works, BUT:

- Always "use strict", and add the -w switch. This alone will show
  you problems you might otherwise miss altogether.
- If you are in any doubt as to whether your data is being read
  correctly, or where you variables might go out of scope, put in
  print statements after every assignment and change of scope to
  test your assumptions.
- For LoLs and other complex data structures you should familiarise
  yourself with the Data::Dumper module (in the std library -- type
  'perldoc Data::Dumper') to check the content of your data structures.
- You should have included a sample entry from your data file --
  as you can see, I'm only guessing that your regex is to blame.

Cheers,
Damian



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

Date: Wed, 10 Jan 2001 14:06:37 +0100
From: "claudio militello" <claudio.militello@infos.es>
Subject: problems perl odbc SQL-Server 7.0: no records with tinyint
Message-Id: <93hmqm$akk$1@lola.ctv.es>

I have a problem with perl odbc accessing SQL-Server 7.0:

when I try to read from DB tinyint fields I get no records !

perl odbc version: 307
odbc: sqlserv32.dll ver: 3.70.06.23
perl: activestate build 613

this run and returns records:

$SGC = new Win32::ODBC($DSN);
if ($SGC) {
 print "Conexion SGC OK.\n";
} else {
 print " ERROR Abertura conexion: $DSN\n";
 exit;
}
$sql =  "SELECT TE_ID from TELEFONOS";
$SGC->Sql($sql);

while($SGC->FetchRow()) {
      %telefonosHash = $SGC->DataHash;
     $teId = sakaIntFromOdbc($telefonosHash{"TE_ID"});
     print "tel: $teId \n";
}
print "fin\n";
$SGC->Close();

but if I try this:
this run and returns no record:

$SGC = new Win32::ODBC($DSN);
if ($SGC) {
 print "Conexion SGC OK.\n";
} else {
 print " ERROR Abertura conexion: $DSN\n";
 exit;
}
$sql =  "SELECT TE_ID,C_MIN from TELEFONOS";
$SGC->Sql($sql);

while($SGC->FetchRow()) {
      %telefonosHash = $SGC->DataHash;
     $teId = sakaIntFromOdbc($telefonosHash{"TE_ID"});
     print "tel: $teId \n";
}
print "fin\n";
$SGC->Close();

I get no records. C_MIN field type is tinyInt

Any Idea?




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

Date: Wed, 10 Jan 2001 13:22:57 GMT
From: Jeff Helman <jhelman@wsb.com>
Subject: Re: problems perl odbc SQL-Server 7.0: no records with tinyint
Message-Id: <4doo5tgbc0l1q64i0iei4j57hntmamlhsq@4ax.com>

On Wed, 10 Jan 2001 14:06:37 +0100, "claudio militello"
<claudio.militello@infos.es> wrote:


>$SGC = new Win32::ODBC($DSN);
>if ($SGC) {
> print "Conexion SGC OK.\n";
>} else {
> print " ERROR Abertura conexion: $DSN\n";
> exit;
>}
>$sql =  "SELECT TE_ID from TELEFONOS";
>$SGC->Sql($sql);

You check to make sure that your server connection opened, but you
don't check to see if your query executed?

if ($SGC->Sql($sql)) {
    my $error = $SGC->Error();
    print "Error executing query: $error\n";
} else {
    ## PARSE YOUR DATA HERE
}

Change both of your queries to this format and see if your second
query is returning an error.

JH



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

Date: Wed, 10 Jan 2001 05:27:44 GMT
From: Alex Hart <news@#nospam#althepal.com>
Subject: Re: regular expression for csv, but different
Message-Id: <kpS66.1218$CN6.292553@typhoon2.ba-dsg.net>

Bart Lateur wrote:

> Alex Hart wrote:
>
> >I know that there are modules out there to do comma separated values,
> >but how about this regular expresssion for separating values. I am
> >working with email addresses, so values can be partly in quotes, and
> >partly outside of quotes.
> >
> >Can anyone find data that will break this regular expression.
>
> You should at least take a look at this entry in the FAQ:
>
>   How can I split a [character] delimited string except when inside
>   [character]? (Comma-separated files)
>
> (perlfaq4)
>
> (Or do: perldoc -q split)
>
> --
>         Bart.

I've seen the faq, and I understand the faq, but my question is
different. The regular expression given in the faq requires that the
fields be completely surrounded by quotes, like ,"one entry",. But I'm
looking for an expression that will find things like ,"Name"email@dom,. I
think you'll find that the regular expression in the faq fails on this
example, and will split it into 2 fields.

--

- Alex Hart



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

Date: 10 Jan 2001 07:30:14 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: system() method won't change directories!
Message-Id: <93h326$91t$1@bob.news.rcn.net>

Wyzelli <wyzelli@yahoo.com> wrote:
> <2obvious@my-deja.com> wrote in message
> news:93gfau$n2c$1@nnrp1.deja.com...
>> I'm a Windows 98 user who is trying to use the system() method to get
>> into my c:\program files directory.  But I don't seem to be able to
> get
>> out of the c:\perl\bin directory.
>>
>> system("cd.."); doesn't change directories.  Nor does
>> system("cd\progra~1");
>>
>> I know that the directory hasn't changed, because if I include
>> system("dir >file.txt"); after either of the lines above, the contents
>> of file.txt are always from the c:\perl\bin directory.
>>

> Well, it would, but only for the duration of the actual system command.
> The environment of a sub-program (system) can not change the parent
> (your script).

> look into the Perl command 'chdir'

> perldoc -f chdir

Which suffers from the same limitation.

AFAIK, the only practical way to have a Perl program make a persistent
change to the user's working directory is to run it from a batch file
and have the Perl program generate a temporary batch file containing a CD
command, like the following:

@echo off
perl myprog
call myprog_cd.bat
del myprog_cd.bat

Where "myprog" generates the file myprog_cd.bat, which reads like:

cd mynewdir

This works because a batch file runs in the same process it's called from
rather than spawning a new process.



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

Date: 10 Jan 2001 08:04:15 GMT
From: ebohlman@omsdev.com (Eric Bohlman)
Subject: Re: system() method won't change directories!
Message-Id: <93h51v$91t$3@bob.news.rcn.net>

Eric Bohlman <ebohlman@omsdev.com> wrote:
> Wyzelli <wyzelli@yahoo.com> wrote:
>> perldoc -f chdir

> Which suffers from the same limitation.

Just to clarify, I was assuming that the OP wanted his program to exit
with a new current directory set.  If he just needs to change the current
directory for the duration of his program, then chdir() will of course
work just fine.



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

Date: 10 Jan 2001 08:45:17 GMT
From: fight_against_spam_cut_here_retoh@dplanet.ch (Reto Hersiczky)
Subject: Re: system() method won't change directories!
Message-Id: <Xns902568FFDfightagainstspamcuth@195.141.200.222>


Each system() call creates its own environment.
The cheapiest way to get your wanted effect
is to code something like this:

system("cd YOUR_PATH; ./YOUR_SCRIPT) && die $!;

This will work.
--Reto



[posted and mailed]

2obvious@my-deja.com wrote in <93gfau$n2c$1@nnrp1.deja.com>:

>I'm a Windows 98 user who is trying to use the system() method to get
>into my c:\program files directory.  But I don't seem to be able to get
>out of the c:\perl\bin directory.
>
>system("cd.."); doesn't change directories.  Nor does
>system("cd\progra~1");
>
>I know that the directory hasn't changed, because if I include
>system("dir >file.txt"); after either of the lines above, the contents
>of file.txt are always from the c:\perl\bin directory.


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

Date: Wed, 10 Jan 2001 08:44:39 GMT
From: rgarciasuarez@free.fr (Rafael Garcia-Suarez)
Subject: Re: Taking control
Message-Id: <slrn95o882.eou.rgarciasuarez@rafael.kazibao.net>

Fing Lamer wrote in comp.lang.perl.misc:
> My boss noticed people come to our web site but don't buy much of our
> stuff. So he asked me to write a program to:
> 
> 1. Make sure our site always comes first in search engine listings.

Have your own search engine. Advertise it extensively. Develop your own
browser and put your search engine as the default start page -- and
don't allow users to change it. Buy competitors, or destroy them with
some FUD.

> 2. Force people to come to our site even if another listing looks more
> attractive.

Make a 'network' of web sites only linked to themselves, and advertise
it as the 'internet', so the users of your browser don't even know there
are other sites.

> 3. Make them stay on our site until they buy something.
> 
> 4. Wipe out their hard disk if they leave without buying anything.

This is not difficult to implement if your make your own browser and if
it is deeply integrated with the OS (advertise it as a "core
component"). Just in case, make your own OS.

Hope it helps.

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


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

Date: Wed, 10 Jan 2001 09:21:28 GMT
From: Alex Hart <news@#nospam#althepal.com>
Subject: Re: Untaint the following string.
Message-Id: <sQV66.1667$jk6.352784@typhoon2.ba-dsg.net>

Arthur Dalessandro wrote:

> I have to untaint the following string, does anyone have any idea why this
> is not working?
> $dn = $1 if ($data =~ /^([ *,-\@\^\w.]+)$/);

try putting the dash (-) at either end of the brackets, instead of in the
middle

>
>
> where
> $data = 'cn=^Group,ou=groups,ou=company,o=arius.com';
> or $data = 'dn=cn=^Group Name, ou=groups, ou=company, o=arius.com';
>
> -Art

--

- Alex Hart




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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
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: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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


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