[17423] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4843 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Nov 8 09:05:38 2000

Date: Wed, 8 Nov 2000 06:05:18 -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: <973692318-v9-i4843@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Wed, 8 Nov 2000     Volume: 9 Number: 4843

Today's topics:
    Re: $password = crypt($pass, ar); (Michel Dalle)
    Re: atoi for Perl <iltzu@sci.invalid>
    Re: Backtick problems on Windows98 <peter.lerup@ecs.ericsson.se>
    Re: DBI and mysql <james@NOSPAM.demon.co.uk>
        Deleting from file? <erik@bid2day.no>
    Re: Deleting from file? nobull@mail.com
    Re: Deleting from file? <josef.moellers@fujitsu-siemens.com>
    Re: Deleting from file? <latsharj@my-deja.com>
    Re: Emailing formatted <james@NOSPAM.demon.co.uk>
        getgrgid does not work with nis (perl 5.6.0) <Olivier.Lacroix@ciril.fr>
    Re: Google module help <gellyfish@gellyfish.com>
    Re: Help -- msgget with key >= 0x80000000 fails <geoff-at-farmline-dot-com@127.0.0.1>
    Re: Help -- msgget with key >= 0x80000000 fails (Martien Verbruggen)
        HELP HOMEWORK!!! <vortex@ptt.yu>
    Re: HELP HOMEWORK!!! <dj.peppone@gmx.net>
    Re: HELP HOMEWORK!!! <frnack.caron@infineon.com>
    Re: HELP HOMEWORK!!! <dj.peppone@gmx.net>
        Help with HTML::Parser module <eliseo@cocoon.ulpgc.es>
    Re: How to return @Array1 and @Array2? <MiGuenther@lucent.com>
        Install a PipeServer for WINNT? <mmarks@gfma.de>
        Installationsproblem WWW-Serach von ActiveState (Johannes Eble)
        locale problems <sune_stromming@my-deja.com>
        Mail mapping from "=?iso-8859-1?Q?=C4=DC=D6_=3F1" -> "  <dirk.harms@nokia.com>
    Re: MS SQL & Perl <gellyfish@gellyfish.com>
        Newbie column data question jocke1s@my-deja.com
    Re: Newbie column data question <frnack.caron@infineon.com>
    Re: Novice silly question: Delete a file <dsimonis@fiderus.com>
    Re: OOP and information hiding (Abigail)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Wed, 08 Nov 2000 11:40:51 GMT
From: michel.dalle@usa.net (Michel Dalle)
Subject: Re: $password = crypt($pass, ar);
Message-Id: <8ube82$pps$1@news.mch.sbs.de>
Keywords: Muzak, consonantal, hypocycloid, oppression

In article <3a087859.6a61$127@news.op.net>, mjd@plover.com (Mark-Jason Dominus) wrote:
>In article <UKZN5.64164$E85.1706681@news1.sttls1.wa.home.com>,
>John <nobodyshere@com.home> wrote:
>>Hi, Eric.  I don't have an answer for you.. but I would like a copy of that
>>code you have if it's open to sharing?
>
>Code that does that is available at
>
>        http://perl.plover.com/IAQ/
[snip]

Excellent - I must have missed this one somehow.
Bookmarked for future reference :)


Michel.


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

Date: 8 Nov 2000 08:33:29 GMT
From: Ilmari Karonen <iltzu@sci.invalid>
Subject: Re: atoi for Perl
Message-Id: <973672289.9127@itz.pp.sci.fi>

In article <8u5j8j$af8$1@charm.magnus.acs.ohio-state.edu>, Ilya Zakharevich wrote:
>[A complimentary Cc of this posting was sent to Uri Guttman 
><uri@sysarch.com>],
>who wrote in article <x7itq1hgbl.fsf@home.sysarch.com>:
>> >>>>> "dd" == dick dijk <ddijk@hetnet.nl> writes:
>> 
>>   dd> Does anyone know the "atoi()" function (from C) equivalent in Perl?
>> 
>> $x = $x ;
>
>Sorry, but this was atold()...

Oh well.  $x = int($x), then.

-- 
Ilmari Karonen -- http://www.sci.fi/~iltzu/
"Get real!  This is a discussion group, not a helpdesk.  You post
 something, we discuss its implications.  If the discussion happens to
 answer a question you've asked, that's incidental." -- nobull in clpm




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

Date: Wed, 8 Nov 2000 13:24:06 +0100
From: "Peter Lerup" <peter.lerup@ecs.ericsson.se>
Subject: Re: Backtick problems on Windows98
Message-Id: <8ubg3a$g5b$1@newstoo.ericsson.se>


"Jeff Zucker" <jeff@vpservices.com> wrote in message
news:3A088450.E8B6807C@vpservices.com...
> Peter Lerup wrote:
> >
> > The problem is that on some Windows 98 machines the redirection of
stdout
> > doesn't seem to work. Whenever doing anything like
> >
> > $a = `dir`;
> >
> > The result of the command goes directly to the console window and not
into
> > the variable.
>
> Works fine on my win98 with ActiveState perl, build 618.
>
> And since you say it works on *some* of your win98 machines, I suggest
> you look at other differences between the machines.  For example, what
> version of perl is on each machine?  There were a couple of builds of
> ActiveState (613 and some others, IIRC) that had problems with
> backticks.  Check the bug reports and change logs on the activestate
> site, I'm pretty sure they mention this problem.
>

Ok let me try and clarify my somewhat imprecise first post:
All machines are running the same version of Perl (from the same location on
the network). I've tried 5.003_07 build 315 (which we normally use) and
5.6.0 build 613. The machines are using the exact same version of Windows98
(as far as I can tell), however the hardware is different

The `dir` was just used in order to try and provide a simple example.

I'm quite sure that the problem is not in Perl but in the "command.com"
shell. My hope was just that someone else have seen this occur when running
Perl and had a solution. I've dug trough all the possible settings for the
command shell but the same (all default) settings are used on a machine
where the script works and on one where it doesn't.

It seems like it's the redirection of stdout when launching other programs
that's not working. The following construction doesn't work either for
instance, the output still goes to the console

open(STDOUT, ">nul");
system("dir");

So I guess that the question is what kind of options that can control this
in the command shell and how it can vary between different hardware.

/Peter




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

Date: Wed, 8 Nov 2000 11:46:56 +0000
From: James Taylor <james@NOSPAM.demon.co.uk>
Subject: Re: DBI and mysql
Message-Id: <ant0811560b0fNdQ@oakseed.demon.co.uk>

In article <8uaiva$t2l$1@slb1.atl.mindspring.net>, HappyHippo
<URL:mailto:thalion@wonderd.com> wrote:
> 
> SELECT id FROM items
> WHERE description LIKE $query
> OR title LIKE $query
> LIMIT 0,20
> 
> I've used the AND, but I dont want to find the id's where
> both cases exist, I need to get them where either cases exist.

Sounds like you want the OR to be an exclusive OR. Sadly MySQL
does not appear to have an XOR or EOR operator, so you'll just
have to write it out in full:

SELECT id FROM items
WHERE description LIKE $query AND title NOT LIKE $query
OR title LIKE $query AND description NOT LIKE $query
LIMIT 0,20

Time to lobby for an XOR operator perhaps. :-)

-- 
James Taylor <james (at) oakseed demon co uk>
PGP key available ID: 3FBE1BF9
Fingerprint: F19D803624ED6FE8 370045159F66FD02



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

Date: Wed, 8 Nov 2000 13:50:42 +0100
From: "Erik Pedersen" <erik@bid2day.no>
Subject: Deleting from file?
Message-Id: <D_bO5.227$cr6.1634@news1.oke.nextra.no>

Hi,

I wonder how should I delete one line at a time from a file.

I read one line from a file. After I red the line in to my variable I want
to delete it! How shall I do that?

Tanks for your help

Best regards
Erik Pedersen




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

Date: 08 Nov 2000 13:09:49 +0000
From: nobull@mail.com
Subject: Re: Deleting from file?
Message-Id: <u9puk6haoy.fsf@wcl-l.bham.ac.uk>

"Erik Pedersen" <erik@bid2day.no> writes:

> I wonder how should I delete one line at a time from a file.

I wonder what the FAQ says about this.

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


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

Date: Wed, 08 Nov 2000 14:29:05 +0100
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: Deleting from file?
Message-Id: <3A095521.809A59E3@fujitsu-siemens.com>

Erik Pedersen wrote:
> =

> Hi,
> =

> I wonder how should I delete one line at a time from a file.
> =

> I read one line from a file. After I red the line in to my variable I w=
ant
> to delete it! How shall I do that?

This is usually done by constructing a replacement file containing the
contents of the old file that you want to keep, so if you don't want to
keep the file, you just read it and zap it at the end.
Alternatively you can copy it to a temporary file, zap it, and work on
the temp copy.

-- =

Josef M=F6llers (Pinguinpfleger bei FSC)
	If failure had no penalty success would not be a prize (T.  Pratchett)


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

Date: Wed, 08 Nov 2000 13:17:52 GMT
From: Dick Latshaw <latsharj@my-deja.com>
Subject: Re: Deleting from file?
Message-Id: <8ubjps$g28$1@nnrp1.deja.com>

In article <D_bO5.227$cr6.1634@news1.oke.nextra.no>,
  "Erik Pedersen" <erik@bid2day.no> wrote:
> Hi,
Hello.

> I wonder how should I delete one line at a time from a file.

Read perlfaq5:
How do I change one line in a file/delete a line in a file/insert a
line in the middle of a file/append to the beginning of a file?

--
Regards,
Dick


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 8 Nov 2000 12:41:08 +0000
From: James Taylor <james@NOSPAM.demon.co.uk>
Subject: Re: Emailing formatted
Message-Id: <ant081208b49fNdQ@oakseed.demon.co.uk>

In article <GTVN5.55191$mv2.203160@news2-win.server.ntlworld.com>, abaltd
<URL:mailto:abaltd@ntlworld.com> wrote:
>
> That was the basis of my thinking: just "pretend" that it came from a
> MIME-formatted message...
> i.e. include:
> 
> From: alan.dougall@virgin.net
> Subject: Hello there
> Mime-Version: 1.0
> Content-Type: multipart/alternative;
> boundary="----=_NextPart_000_C0_KBO0LAAA"
> (and so on)

You appear to have the boundary="" line as a separate line from
Content-Type: so perhaps that's the problem. When RFC822 header lines
are folded the subsequent lines must start with whitespace (usually a
tab character).

I would definitely recommend using an established module to build MIME
messages because the author will have made all the mistakes and
widespread peer review will have corrected most of them already.
There's no point in going through it all yourself. I've heard that
MIME::Lite is simple to use so why don't you check it out.

> No, normally just sendmail -t !!
> (checking man sendmail: -oi ignores '.'s at beginning of lines??)

Yes, you need -oi otherwise a chance '.' in the email body could
terminate the message early thus corrupting it.

> Can I assume that the MIME::Tools library will already be on the
> ASP's host server?

They ought to have it installed if they are worth their salt, but
if they don't, you can install it yourself and add the path to it
into @INC using the "use lib" pragma.

> Looking at the message source of the resultant email, I notice
> there is a X-UIDL after the Content-Type
[snip]

Yes, so it looks like you have folded the boundary="" line incorrectly
as I mentioned above. Save yourself a lot of trouble, use MIME::Lite.

-- 
James Taylor <james (at) oakseed demon co uk>
PGP key available ID: 3FBE1BF9
Fingerprint: F19D803624ED6FE8 370045159F66FD02



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

Date: Wed, 08 Nov 2000 14:36:08 +0100
From: Olivier LACROIX <Olivier.Lacroix@ciril.fr>
Subject: getgrgid does not work with nis (perl 5.6.0)
Message-Id: <3A0956C8.202F1D79@ciril.fr>

Hello.

I have a problem with getgrgid (and with all commend getgr*). It returns
the correct value for all local groups, but returns NULL value for all
groups in the NIS database. I think there is a bug, because all commands
getpw* work (even with NIS).

This command was good with perl 5.005.

My configuration is :
perl 5.6.0
HPUX 10.20

Thanks for your help.

--

 Olivier LACROIX
 C.I.R.I.L.
 Cellule Réseau StanNet
 Chateau du Montet   |  Tel   : +33 3.83.44.74.29
 Rue du Doyen Roubault  |  Fax   : +33 3.83.44.02.62
 F - 54500 VANDOEUVRE   |  email : Olivier.Lacroix@ciril.fr




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

Date: 8 Nov 2000 07:11:12 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: Google module help
Message-Id: <8uauag$j53$1@orpheus.gellyfish.com>

On Mon, 6 Nov 2000 12:02:23 -0000 jp wrote:
> Hi,
> I'm wondering if anyone who has used the Google.pm 
> 

OK Maybe I'm going blind but there doesnt appear to be a Google module
on CPAN - well not on monday anyhow ... maybe you could be more specific.

/J\
-- 
Jonathan Stowe                      |     
<http://www.gellyfish.com>          |      This space for rent
                                    |


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

Date: Wed, 8 Nov 2000 10:20:48 -0000
From: "Geoff Winkless" <geoff-at-farmline-dot-com@127.0.0.1>
Subject: Re: Help -- msgget with key >= 0x80000000 fails
Message-Id: <8ub9an$lsa$1@soap.pipex.net>

"Geoff Winkless" <geoff-at-farmline-dot-com@127.0.0.1> wrote in message
news:8u92mh$hut$1@soap.pipex.net...
> Now if I knock off the top bit from these numbers, and use 0x60ffe0ff and
> 7fe0ffe0 respectively, the queues are created correctly -- so I'm guessing
> there's something up with signed and unsigned numbers.

I take it no-one knows what's wrong then?

*sigh*

Geoff




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

Date: Wed, 8 Nov 2000 22:47:59 +1100
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Help -- msgget with key >= 0x80000000 fails
Message-Id: <slrn90ifbf.boe.mgjv@martien.heliotrope.home>

On Wed, 8 Nov 2000 10:20:48 -0000,
	Geoff Winkless <geoff-at-farmline-dot-com@127.0.0.1> wrote:
> "Geoff Winkless" <geoff-at-farmline-dot-com@127.0.0.1> wrote in message
> news:8u92mh$hut$1@soap.pipex.net...
>> Now if I knock off the top bit from these numbers, and use 0x60ffe0ff and
>> 7fe0ffe0 respectively, the queues are created correctly -- so I'm guessing
>> there's something up with signed and unsigned numbers.
> 
> I take it no-one knows what's wrong then?
> 
> *sigh*

Sheesh. Give it a bit of time. Usenet can take days to propagate news
all over the network.

One thing you could do, in the meantime, is check the Perl code to see
what goes on when you call these functions, and compare them with what 
they should do. It is possible that the Perl 5.005_03 code uses an int
when they should use a key_t. Perl 5.6.0 uses

    key = (key_t)SvNVx(*++mark);

which looks like a cast from a double to a key_t. Maybe that is just not
correct. Try it out in C, and see if it works. Check the 5.005_03
sources first, to see how exactly it happens there (doio.c).

However, on my GNU/Linux system, 

# grep key_t /usr/include/bits/types.h 
typedef int __key_t;

So  there really shouldn't be a problem any way.

Is this the perl that comes with RedHat? If so, chuck it and compile
your own. Your problem might just go away. it wouldn't be the only thing
that suddenly would repair itself.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | life ain't fair, but the root
Commercial Dynamics Pty. Ltd.   | password helps. -- BOFH
NSW, Australia                  | 


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

Date: Wed, 08 Nov 2000 08:06:36 GMT
From: Milan Miladinovic <vortex@ptt.yu>
Subject: HELP HOMEWORK!!!
Message-Id: <8ub1i9$202$1@nnrp1.deja.com>

Hello,
I got for home work to do this

*
Consider the following program:

  #! /usr/local/bin/perl5.003 -w

  {
        my($string) = "brad<hello>3hello";
        $string =~ /^[^\d]{2,4}<([^>]+)>\d?\1$/;
        if( defined($1) ) {
                print "$1\n";
        } else {
                print "not found\n";
        }
  }

Explain what the regular expression is trying to match?
*

Could anybody help me. I do not know answer!!!!


--
____________________
Milan Miladinovic
vortex@ptt.yu


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 08 Nov 2000 10:12:03 +0100
From: Alexander Nietzschmann <dj.peppone@gmx.net>
Subject: Re: HELP HOMEWORK!!!
Message-Id: <3A0918E3.722ED21D@gmx.net>

>         my($string) = "brad<hello>3hello";
>         $string =~ /^[^\d]{2,4}<([^>]+)>\d?\1$/;
>         if( defined($1) ) {
>                 print "$1\n";
>
> Explain what the regular expression is trying to match?

ok:

^ = begin of line
[^\d]{2,4} = not a digit of length 2 or 4 (the "brad")
< = <
([^>]+) = one or more signs (+) which are not ">" (this is the "hello")
> = >
\d? = no or one digit (the "3")
\1 => is this a "one" or the letter "l"???
$ = end of line

Try reading Jeffrey Friedel's book "Regular expressions in Perl"
(O'Reilly), if You don't understand this.

Greets, Alex


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

Date: Wed, 08 Nov 2000 10:58:27 +0100
From: Caron Franck <frnack.caron@infineon.com>
Subject: Re: HELP HOMEWORK!!!
Message-Id: <3A0923C3.64490841@infineon.com>

there is just one mistake in the interpretation :

Alexander Nietzschmann wrote:

> >         my($string) = "brad<hello>3hello";
> >         $string =~ /^[^\d]{2,4}<([^>]+)>\d?\1$/;
> >         if( defined($1) ) {
> >                 print "$1\n";
> >
> > Explain what the regular expression is trying to match?
>
> ok:
>
> ^ = begin of line
> [^\d]{2,4} = not a digit of length 2 or 4 (the "brad")
> < = <
> ([^>]+) = one or more signs (+) which are not ">" (this is the "hello")

in addition the bracket ( ) means that the sub match in [^>]+ will be
stocked in $1

>
> > = >
> \d? = no or one digit (the "3")
> \1 => is this a "one" or the letter "l"???

\1 means that match what is in the $1
for ex : ba<jojo>1jojo will match but  ba<jojo>1jolo  will not cause the
jojo in <> is stocked in $1 within the ([^\d]+) patern matching .

>
> $ = end of line
>
> Try reading Jeffrey Friedel's book "Regular expressions in Perl"
> (O'Reilly), if You don't understand this.
>
> Greets, Alex

-- franck



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

Date: Wed, 08 Nov 2000 13:07:08 +0100
From: Alexander Nietzschmann <dj.peppone@gmx.net>
Subject: Re: HELP HOMEWORK!!!
Message-Id: <3A0941EC.5DE9E31F@gmx.net>

> > \1 => is this a "one" or the letter "l"???
> 
> \1 means that match what is in the $1
> for ex : ba<jojo>1jojo will match but  ba<jojo>1jolo  will not cause the
> jojo in <> is stocked in $1 within the ([^\d]+) patern matching .
> 
> >
> > $ = end of line
> >
> > Try reading Jeffrey Friedel's book "Regular expressions in Perl"
> > (O'Reilly), if You don't understand this.
> >
> > Greets, Alex
> 
> -- franck

Yes You're right. Thanks.

Greets, Alex


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

Date: 8 Nov 2000 12:48:00 -0100
From: Juan Eliseo Carrasco =?iso-8859-1?Q?D=EDaz?= <eliseo@cocoon.ulpgc.es>
Subject: Help with HTML::Parser module
Message-Id: <3A094BCF.2020E154@cocoon.ulpgc.es>

I trying to delete all the <font face="Arial"> and <font face="Times new

roman"> marks and its respective </font> marks of my HTML pages, but I
can't find an easy way.

Example:

Text .... <font face="Arial"> more text .... <b> xxx </b> ....
 .... <font size=+1> .... </font> ....
<font face="Times new roman"> <font color=red> .... </font> ...
 .... </font> .... </font>


Desired result:

Text .... more text .... <b> xxx </b> ....
 .... <font size=+1> .... </font> ....
<font color=red> .... </font> ...
 ....  ....


Somebody say me that HTML::Parse module can help me. I downloaded it. I
read the documentation, but I don't know how to start. (I'm a beginner).



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

Date: Wed, 8 Nov 2000 11:04:15 +0100
From: "Michael Guenther" <MiGuenther@lucent.com>
Subject: Re: How to return @Array1 and @Array2?
Message-Id: <8ub8dq$2gg@nntpb.cb.lucent.com>


Ren Maddox wrote in message ...
>fallenang3l@my-deja.com writes:

>sub sub_returning_Arrays {
> my @a1 = (1, 2, 3);
> my @a2 = qw(red blue green);
>return \@a1, \@a2;
>}
>my($arrayRef1, $arrayRef2) = sub_returning_Arrays();
>
>print "@$arrayRef1\n";
>print "@$arrayRef2\n";


As you may know the same way will work in the other direction to handover
arrays into a sub.

sub xyz{
my ($arrayRef,$arrayRef2) = @_;
}


sub xyz(\@arr1\@arr2);


If you use there something like
@$arrayRef[x]="something different";
inside the sub it will have effects to the array in the main. In that way it
is like "call by reference".
Only if you dereference them is like "call by value" then all changes done
in your sub will have no effect to the array in the main.

--
Michael
Murphy always wins.




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

Date: Wed, 08 Nov 2000 12:37:39 +0100
From: Matthias Marks <mmarks@gfma.de>
Subject: Install a PipeServer for WINNT?
Message-Id: <3A093B03.75B1580D@gfma.de>

Hello,...

From WINNT i want to start a several process which is a Perlscript, to
catch Information...

I want to make it with a single-way Pipe...
The Perlscript have to bring the Information to the NT-Application...
-> Client / Server

Does anybody made something in this way ???
if yes, i am interessted in the way you made the NT-Server-side?
--
          MFG Matthias Marks

mmarks@gfma.de oder priv. M.Marks@gmx.de

P.S.: Wirf Deinen Lendenschurz nicht fort,
      wenn Du ein neues Kleid bekommen hast !

      Sprichwort aus dem Kongo




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

Date: Wed, 08 Nov 2000 13:25:12 GMT
From: johannes.eble@arcormail.de (Johannes Eble)
Subject: Installationsproblem WWW-Serach von ActiveState
Message-Id: <3a095246.194502589@news.btx.dtag.de>

Hello,

I want to install the ActiveState Modul WWW-Search on a Win98 PC
without Internet connection.

I have downloaded the *.zip file from
http://www.ActiveState.com/PPMPackages/5.6/zips

(another (Internet) PC WITHOUT Perl) and transferred it to the local
PC. 
Then I have unzipped the files with WinCommander into the path
D:\perl.

As stated in the readme file I opened a dos-console, changed into that
directory and entered the command:
ppm install WWW-Search.ppd

I get the error message: "Error read ./"

I get the same error if I write "ppm install WWW-S~1.ppd" instead.

Thanks for any help :)

Johannes


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

Date: Wed, 08 Nov 2000 13:40:09 GMT
From: Sune <sune_stromming@my-deja.com>
Subject: locale problems
Message-Id: <8ubl3p$h9a$1@nnrp1.deja.com>

I get these messages sometimes when I fool around with
my LANG settings:

Perl: Perl lib version (5.00404) doesn't match executable
version (5,00404) at /usr/local/perl/lib/perl5/5.00404/Config.pm line 7

How can I work around this? For some applications I need to
set the LANG variable, but then I can't run my perl scripts...

I'm running perl 5.00404 under Solaris 2.5.1.

TIA for any help, this is getting really annoying.


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 08 Nov 2000 09:37:02 GMT
From: Harms Dirk <dirk.harms@nokia.com>
Subject: Mail mapping from "=?iso-8859-1?Q?=C4=DC=D6_=3F1" -> " =?iso-8859-1?Q?=C4=DC=D6?="
Message-Id: <3A091ED6.4ABE5F5B@nokia.com>

Hallo!

I'm parsing emails and have the following problem:

some emails (Outlook :-( have a subject e.g.:
=?iso-8859-1?Q?=C4=DC=D6_=3F1
which was:
ÄÜÖ

Does anybody konws a module (CPAN) which allows me
to convert "=?iso-8859-1?Q?=C4=DC=D6_=3F1" back to "ÄÜÖ"?

BR Dirk


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

Date: 8 Nov 2000 07:40:20 -0000
From: Jonathan Stowe <gellyfish@gellyfish.com>
Subject: Re: MS SQL & Perl
Message-Id: <8ub014$j7c$1@orpheus.gellyfish.com>

On Tue, 07 Nov 2000 18:56:48 GMT Rich Parker wrote:
> nobull@mail.com wrote:
> 
>> Rich Parker <RichParker@fssi-ca.com> writes:
>> > For the life of me my
>> > 'my $dbh = DBI->connect($plist, $username, $psw) ...' is not working and
>> > I've tried many, many different combinations for the variables. This
>> > makes me ponder one other question: Did this stuff load correctly (DBI
>> > and/or ODBC)??
>>
>> Dunno, is $dbh defined?  Did you get any errors.
>>
>> > The 'perl makefile.pl' worked just fine, but the 'make'
>> > or 'nmake' gets an unknown command type of msg. What is the key to these
>> > (DBI & ODBC)? Do these belong in certain directories/folders?
>>
>> I recommend getting Perl 5.6.  I'd even recommend getting the
>> Activestate binary if you are running on NT.
>>
> Sorry 'bout that, it is the latest Perl from ActiveState, I downloaded it
> about a week ago.
> 
> The main problem here is when the DBI line is executed, nothing at all comes
> back, so nothing displays. I have tried a 'DIE' when it fails and a call of a
> subroutine that will display info and then die, neither way gets me anything.
> It is very upsetting to debug just one line of code for more than 2 days.
> 
> More ideas???
> 

Could you show us the smallest piece of code that will compile that you
believe isnt working. DBI->connect(...) will return a database handle
(or undef on failure) but is not expected to *display* anything ... 
Perhaps if you are concerned that the connect() is failing then you
should use the RaiseError attribute which will cause a fatal error on
failure.  WHat did you expect connect() to do.

I would suggest you examine the DBI documentation more closely.

  perldoc DBI

/J\
-- 
Jonathan Stowe                      |     
<http://www.gellyfish.com>          |      This space for rent
                                    |


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

Date: Wed, 08 Nov 2000 12:01:02 GMT
From: jocke1s@my-deja.com
Subject: Newbie column data question
Message-Id: <8ubf9s$ctb$1@nnrp1.deja.com>

Hi list,

somewhat of a newbie problem here. Please let me know what list
I should post on if this is the wrong one.

I have a file file looking like this:

1234
9835489435
99233
2000
9374
222
 .
 .
more numbers
 .
 .
 .

or something similar. Just a file with column data.
I need to get output that looks like this.

some text whatever on the first line , "1234 9835489435 99" // @
"233 2000 9374 222 ........... more numbers .....         " // @
"....more numbers ...")
some other text


So my problem is that I need to split the numbers of the
first line at a specific location even if it means the
number is printed on two lines.

I tried
printf "enter file of elements: ";
$el = <STDIN>;
open (ELEMENTS, "$el") || die "Can't find file $el $!\n";
# where $el is my file with column data
while(<ELEMENTS>) { push (@list, split(" ",$_) ) } close(ELEMENTS);
# print @list prints the whole list on one line.

Any ideas how to do this is most welcomed. Even just a hint
on what I could use (splice, split etc)

Best regards
Joakim Svensson


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Wed, 08 Nov 2000 14:07:42 +0100
From: Caron Franck <frnack.caron@infineon.com>
Subject: Re: Newbie column data question
Message-Id: <3A09501E.3841343A@infineon.com>

try that :


use strict;
my $line='';
my $elements_in_one_line='';
my $elements_in_mult_line='';
my path = <STDIN>;
open (FH,$path) or die "can't open $path\n";
while (defined ($line = <FH>)){
    chomp($line); #remove \n
    $elements_in_one_line .= $line.' ';
}
chop $elements_in_one_line; #remove last unuseful space charac.
while ($elements_in_one_line != ''){          #until all line is traited

    $elements_in_one_line =~ s/^(.{0,n})//; # remove the n 1st char and
stock it in $1
    $elements_in_mult_line .= "$1\n";         # cat $1 in the multiline
string
}
print $elements_in_mult_line;


--franck

PS : test it before cause I havn't tested it myself!

jocke1s@my-deja.com wrote:

> Hi list,
>
> somewhat of a newbie problem here. Please let me know what list
> I should post on if this is the wrong one.
>
> I have a file file looking like this:
>
> 1234
> 9835489435
> 99233
> 2000
> 9374
> 222
> .
> .
> more numbers
> .
> .
> .
>
> or something similar. Just a file with column data.
> I need to get output that looks like this.
>
> some text whatever on the first line , "1234 9835489435 99" // @
>



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

Date: Mon, 06 Nov 2000 13:26:12 -0500
From: Drew Simonis <dsimonis@fiderus.com>
Subject: Re: Novice silly question: Delete a file
Message-Id: <3A06F7C4.4A93B58A@fiderus.com>

Toni wrote:
> 
> Hello!
> I know that rmdir delete a directory, but I can't find in my perl doc a way
> to delete a file without using a system() or exec() call to the OS delete
> file command.
> I suppose there is a Perl function to do this easily, can somebody help me?
> 


unlink()


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

Date: 8 Nov 2000 10:18:32 GMT
From: abigail@foad.org (Abigail)
Subject: Re: OOP and information hiding
Message-Id: <slrn90ia3o.na9.abigail@tsathoggua.rlyeh.net>

On 8 Nov 2000 06:07:35 GMT, Damian Conway (damian@cs.monash.edu.au) wrote in comp.lang.perl.misc <URL: news:<8uaqj7$n73$1@towncrier.cc.monash.edu.au>>:
++ tjla@guvfybir.qlaqaf.bet (Gwyn Judd) writes:
++ 
++ >Sure, but you shouldn't have to document the *private* variables that
++ >you use as well. That's what makes them, well, private.
++ 
++ And, in Perl, if you do actually make them private (via closures, or
++ flyweight scalars, or Tie::Securehash) then you *don't* have to
++ document them.


The problem is, there's no easy way to do it, and certainly no 
standard. There's no language support to do so. 

If Larry had left out hashes out of Perl, because one could write
a module or library for them, would people claim Perl supported hashes?
I don't think so.



Abigail


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

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 V9 Issue 4843
**************************************


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