[22768] in Perl-Users-Digest
Perl-Users Digest, Issue: 4989 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu May 15 18:05:38 2003
Date: Thu, 15 May 2003 15:05:12 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Thu, 15 May 2003 Volume: 10 Number: 4989
Today's topics:
Re: "ndbm store" error on Solaris <dontspam@dontspamme.com>
Re: <html> and reg. expressions <nobody@dev.null>
Re: [The/My] trouble with Perl <geenspam@geenspam.biz>
Re: [The/My] trouble with Perl <abigail@abigail.nl>
Re: [The/My] trouble with Perl <geenspam@geenspam.biz>
Re: [The/My] trouble with Perl <ddunham@redwood.taos.com>
Re: [The/My] trouble with Perl <geenspam@geenspam.biz>
Re: [The/My] trouble with Perl <bigj@kamelfreund.de>
Re: [The/My] trouble with Perl <bigj@kamelfreund.de>
A Perl Event Loop (was Re: [The/My] trouble with Perl) <lusol@cube0.CC.Lehigh.EDU>
Re: Can't locate sub.pl <nobull@mail.com>
handler for CGI file upload and name=value <user@someserver123abc.com>
Re: handler for CGI file upload and name=value <huuhaa@kastema.to>
How to access variable in &login_script for use in main <chris_12003@yahoo.com>
How to pass parameter from CR 8 to Stored Procedure <member9187@dbforums.com>
Re: How to query a Microsoft SQL Server with perl? <apollock11@hotmail.com>
HTTP POST & authorization (Alexander Klosch)
Re: I know it is a newbie dumb question but the answer <user@someserver123abc.com>
Perl Debugger <chris_12003@yahoo.com>
Re: Perl Debugger <yanoff@STOP-SPAMMINGyahoo.com>
Re: Perl Debugger <nobull@mail.com>
Re: removing spaces in a string <dodger@dodger.org>
Sorting $array[0] (nbh)
Re: Sorting $array[0] <user@someserver123abc.com>
Re: Sorting $array[0] <bigj@kamelfreund.de>
Re: Why do I get double line feeds <user@someserver123abc.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Thu, 15 May 2003 14:49:56 -0700
From: "Shehzaad Nakhoda" <dontspam@dontspamme.com>
Subject: Re: "ndbm store" error on Solaris
Message-Id: <r1Uwa.10$MU1.128@news.oracle.com>
"Joe Smith" <inwap@inwap.com> wrote in message
news:C7Fwa.16663$io.343810@iad-read.news.verio.net...
<snip>
> The ndbm database interface has arbitrary limits that cause errors
> of EFBIG or ENOSPC when too many keys hash to the same bucket.
> solaris% man ndbm
> The sum of the sizes of a key/content pair must not exceed
> the internal block size (currently 1024 bytes). Moreover all
> key/content pairs that hash together must fit on a single
> block. dbm_store() will return an error in the event that a
> disk block fills with inseparable data.
<snip>
> I recommend switching to gdbm or Berkeley_DB instead of trying
> to program around the limitations of ndbm.
>
Thanks a lot for the reply, Joe. I will recommend a move towards gdbm.
I'm curious to know how exactly one would program around these limitations
i.e. is it even possible? If the ndbm implementation is opaque, one would
never be able to figure out whether a given key would map to a bucket that
is already being used. One could very well check size limits on a given
key/value pair, but how exactly would one know how full the bucket is?
--Shehzaad
> -Joe
>
> P.S. I hit this problem years ago after dumping an ndbm database to
> a flat file and attempting re-import it. The failure depended on which
> order keys were added first.
> --
> See http://www.inwap.com/ for PDP-10 and "ReBoot" pages.
------------------------------
Date: Thu, 15 May 2003 20:21:04 GMT
From: Andras Malatinszky <nobody@dev.null>
Subject: Re: <html> and reg. expressions
Message-Id: <3EC3F637.5040701@dev.null>
berndt.sommer wrote:
> Hi there,
>
> 1. with s/<[^>]+>// I can replace all html tags to nothing.
Almost. But how about
<font size="3" color="bisque" face="Verdana, Arial,
Helvetica, Sans">Man, what a mess!</font>
Or how about
<!-- Here comes the part for age>42 -->
------------------------------
Date: Thu, 15 May 2003 21:07:09 +0200
From: Henk van Bree <geenspam@geenspam.biz>
Subject: Re: [The/My] trouble with Perl
Message-Id: <3ec3d743$0$49106$e4fe514c@news.xs4all.nl>
Darren Dunham wrote:
> If you don't otherwise need perl on your target machines, how about
> perl2exe or PAR installlations?
I still need Tk installed, don't I?
>> Still, I think adding native GUI features to Perl would
>> make the world a better place.
>
> It doesn't sound that that would help you with your perl installation
> problems on the windows boxes.
I think it does. Suppose Perl would have a widget set *built-in*,
then every platform that runs Perl has the same, consistent, way
to code a gui. No matter which underlying OS you use, there is
no hassle with interdependent modules and libs, it just works.
Wouldn't that be the bees knees? I wet myself just thinking about it! ;-)
Henk
------------------------------
Date: 15 May 2003 18:43:44 GMT
From: Abigail <abigail@abigail.nl>
Subject: Re: [The/My] trouble with Perl
Message-Id: <slrnbc7nv0.mth.abigail@alexandra.abigail.nl>
Henk van Bree (geenspam@geenspam.biz) wrote on MMMDXLIV September
MCMXCIII in <URL:news:3ec3cb3a$0$49104$e4fe514c@news.xs4all.nl>:
() Brad Murray wrote:
()
() > I'm surprised at your problems with Tk under windows. I find that the
() > ActivePerl installation has done this properly and reliably for many
() > many versions now. Tk has always worked out of the box for me with
() > Perl on Windows.
()
() For development, yes, you are right. But I need to deploy the program
() to 3500 client machines, and installing a complete ActiveState installation
() on them is just not possible (outside my control). So I've been trying to
() package Tk in a Windows installer script and so far it just isn't reliable.
() It works on maybe 80% of machines (wildly differing hardware and/or
() software) and fails on the rest for a variety of reasons.
I'm confused. You make an application, and as part of the application
it's ok to include Tk, which has a buttload of files, but it's not ok
to roll out Perl, which is also just a buttload of files?
I'm not suggesting to replace /usr/bin/perl, or whereever your systems
Perl is installed. But your application could bundle Perl, and whatever
libraries you need. This will save you a lot of hassle, and you won't
have to worry whether the installed Perl uses 64bit integers, threads,
its own malloc or the systems, or is compiled with some kinky compiler
you don't access to.
() Maybe I'm just in a weird environment (mixed Linux and Windows pc's) but
() I really need to run the same Perl code on different platforms.
()
() Henk
() (Now if there was a Perl2Java converter... Haha, only serious... :-( )
Many Java application come with their own run time environment. Perl
application can do that too.
Abigail
--
perl -MLWP::UserAgent -MHTML::TreeBuilder -MHTML::FormatText -wle'print +(
HTML::FormatText -> new -> format (HTML::TreeBuilder -> new -> parse (
LWP::UserAgent -> new -> request (HTTP::Request -> new ("GET",
"http://work.ucsd.edu:5141/cgi-bin/http_webster?isindex=perl")) -> content))
=~ /(.*\))[-\s]+Addition/s) [0]'
------------------------------
Date: Thu, 15 May 2003 22:07:28 +0200
From: Henk van Bree <geenspam@geenspam.biz>
Subject: Re: [The/My] trouble with Perl
Message-Id: <3ec3e567$0$49104$e4fe514c@news.xs4all.nl>
Abigail wrote:
> I'm confused. You make an application, and as part of the application
> it's ok to include Tk, which has a buttload of files, but it's not ok
> to roll out Perl, which is also just a buttload of files?
That's the short version of it, yes. The application will be deployed
in several financial institutions (banking and insurance) and one of
the requirements is that there can be no (as in none whatsoever)
development tools on the client machines. Combined with other rather
stringent security measures this will ensure no-one tampers with
the programs and datasets.
> I'm not suggesting to replace /usr/bin/perl, or whereever your systems
> Perl is installed. But your application could bundle Perl, and whatever
> libraries you need. This will save you a lot of hassle, and you won't
> have to worry whether the installed Perl uses 64bit integers, threads,
> its own malloc or the systems, or is compiled with some kinky compiler
> you don't access to.
It this moment I'm still exploring the environment in which the application
will run. I am testing the various options (widget sets, various perl
compilers and such) to decide which to use to develop the application.
Most of the business logic is already written as part of other applications
(non-gui) so it's mostly integrating of existing code and wrapping it up
in a gui.
If I've learned something over the past few days it is that info on
how to develop portable GUI apps in Perl isn't readily available.
Henk
------------------------------
Date: Thu, 15 May 2003 19:07:28 GMT
From: Darren Dunham <ddunham@redwood.taos.com>
Subject: Re: [The/My] trouble with Perl
Message-Id: <QzRwa.1122$On7.101467380@newssvr21.news.prodigy.com>
Henk van Bree <geenspam@geenspam.biz> wrote:
> Darren Dunham wrote:
>> If you don't otherwise need perl on your target machines, how about
>> perl2exe or PAR installlations?
> I still need Tk installed, don't I?
Just on your development machine. Not on the machines you're
distributing to.
>> It doesn't sound that that would help you with your perl installation
>> problems on the windows boxes.
> I think it does. Suppose Perl would have a widget set *built-in*,
> then every platform that runs Perl has the same, consistent, way
> to code a gui. No matter which underlying OS you use, there is
> no hassle with interdependent modules and libs, it just works.
I meant, "It sounds like you're having a problem installing perl on lots
of windows machines". While having a GUI more native to perl would be
great, It wouldn't ease the task of getting perl and all its components
installed in the first place..
--
Darren Dunham ddunham@taos.com
Unix System Administrator Taos - The SysAdmin Company
Got some Dr Pepper? San Francisco, CA bay area
< This line left intentionally blank to confuse you. >
------------------------------
Date: Thu, 15 May 2003 22:42:19 +0200
From: Henk van Bree <geenspam@geenspam.biz>
Subject: Re: [The/My] trouble with Perl
Message-Id: <3ec3ed93$0$49105$e4fe514c@news.xs4all.nl>
Darren Dunham wrote:
>> I still need Tk installed, don't I?
>
> Just on your development machine. Not on the machines you're
> distributing to.
Hmm, I was under the impression I required at least 'tk?.dll'
and some windows registry settings. I'll look into that!
> I meant, "It sounds like you're having a problem installing perl on lots
> of windows machines". While having a GUI more native to perl would be
> great, It wouldn't ease the task of getting perl and all its components
> installed in the first place..
True. I can use an existing install wizard for simple file manipulation,
but that gets impractical for loads of files and/or settings, especially
as the machines are configured diffently.
I hope to find a solution that only gets me a MyApp.exe and some support
files.
Henk
------------------------------
Date: Thu, 15 May 2003 20:36:36 +0200
From: "Janek Schleicher" <bigj@kamelfreund.de>
Subject: Re: [The/My] trouble with Perl
Message-Id: <pan.2003.05.15.18.36.35.366978@kamelfreund.de>
Henk van Bree wrote at Thu, 15 May 2003 19:30:42 +0200:
>> (3) spamcodes his email address
>
> True. I'm getting over a hundred (100) spams a day already,
> I have no desire for more. If you have a solution to my
> problem that you are not willing or able to post but are
> willing and able to mail, please use the address below, your
> input is greatly appreciated.
Have a look to the CPAN module
Mail::SpamAssassin
Greetings,
Janek
------------------------------
Date: Thu, 15 May 2003 21:15:00 +0200
From: "Janek Schleicher" <bigj@kamelfreund.de>
Subject: Re: [The/My] trouble with Perl
Message-Id: <pan.2003.05.15.19.09.13.886487@kamelfreund.de>
Henk van Bree wrote at Wed, 14 May 2003 21:48:31 +0200:
> I know good work is being done on Perl version 6, but may I input a
> suggestion for Perl version 7:
>
> **Let Perl 7 have a native GUI widget set!**
>
> So far I've tried to get Qt, WxWindows, Gtk and/or Tk to work, with several
> degrees of succes but it just doesn't work everytime.
These are all native GUI widget sets.
The Perl modules are mostly only wrappers around the native parts.
> Sure, I could maybe get it to work on my *development* machine, but at
> deployment time the whole scene changes: Perl is nice and portable but I've
> yet to see a (non-trivial) Perl GUI application working on GNU/Linux and
> Windows from the same code-base. It just can't be done. Perhaps I'm just
> not bright enough or maybe, just maybe the whole module circus is a wee bit
> sucky.
Perhaps the simplest answer, why it shouldn't be a "fixed" (core) part of
Perl is, that it would break the main principle of Perl:
There's More Than One Way To Do It.
If you want a native GUI widget set,
just write one.
But don't force me to use it or even to download it,
only because anyone thought it is necessary.
(Personally I'm programming now in Perl for nearly 3 years,
but I needed a graphic output for only 1 month in all the years.
If I would have worked me in a complicated graphic toolkit -
as every graphic toolkit is complicated when it is complex -
I would have needed 2 months for the job,
and the output would have been perhaps only slightly better.
)
And if it isn't in the core modules of Perl,
you would still have the same installing troubles later.
It's quite the same like with some other modules in Perl.
Does Perl have a standard way to work with configuration files ?
No, you can choose between many of the Config modules.
Same is with XML support.
Same is with nearly everything in Perl.
It is the philosophy of Perl,
that the programmer can and will choose what he/she needs or wants for
his/her job.
Let's see it in a different way.
Java e.g. has something like a native GUI widget set
(Don't flame me, I'm not really a Java expert, if it's wrong)
That's on the one hand nice as you can guarantee that the application
looks the same at the client side as on your developper side.
But it also has some downsides.
Even if the client doesn't need the graphic,
he will install at least the JRE with >20 MB IIRC,
where the Perl interpreter works with <1 MB + the module sizes.
As it is designed to handle all possible features,
also for really large and difficult graphic outlooks,
it is also very complex.
You have to understand Pack-Managers, Call-Backs, Threads, the
Model-View-Controller Concept, Object Oriented Programming, ... .
What if you only want to output a simple table with some actions
e.g. to visualize a report.
Nowadays in Perl, you have the choice,
taking the simple Tk,
the quick and beautiful, but harder to program, Qt,
the known feeling from [mw]xWindows,
a complete different interface from PRIMA,
or what I would suspect of professional program,
the superquick, programmer friendly Curses interface.
I don't say that the Java way is better or worse,
it's just another philosophy that wouldn't fit to Perl and its programmers
IMHO.
Greetings,
Janek
------------------------------
Date: 15 May 2003 18:15:36 GMT
From: Steve Lidie <lusol@cube0.CC.Lehigh.EDU>
Subject: A Perl Event Loop (was Re: [The/My] trouble with Perl)
Message-Id: <ba0lg8$gn6@fidoii.CC.Lehigh.EDU>
Darren Dunham <ddunham@redwood.taos.com> wrote:
> Henk van Bree <geenspam@geenspam.biz> wrote:
>> Darren Dunham wrote:
>
>>> What's wrong with Tk?
>
>> Don't get me started... ;-)
>
>> There's nothing inherently wrong with Tk, apart from the
>> trouble that I'm having installing it (see other post).
>
> If you don't otherwise need perl on your target machines, how about
> perl2exe or PAR installlations?
>
>> Still, I think adding native GUI features to Perl would
>> make the world a better place.
I'd like to see an event loop in the core, ala Tcl/Tk. There's the Event
module, and then there is Tk's event loop (which can be easily externalized).
------------------------------
Date: 15 May 2003 21:06:58 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: Can't locate sub.pl
Message-Id: <u9fzngezz1.fsf@wcl-l.bham.ac.uk>
Pierre Couderc <pierre@couderc.cc> writes:
> I am sorry that I am too new to perl to understand what is so "horrible"...
Sorry, I do not understand the significance of this statement.
Do you mean you want to understand? Or do you mean you do not want to
understand?
In order to understand you need to understand what 'package' does and
what 'require' does.
perldoc -f package
perldoc -f require
Once you've digested those consider what it means to require a file
when the file that is required declares subroutines or package
variables without package directive (aka "Perl4-style" library).
It means that those things end up in the package in which the require
statement appears.
Now consider what it means if the require is in a module.
Now consider what it means if the require is in more than one
Only the first module to require the Perl4-style library will actually
get it loaded into its package.
In order to understand what all this has to do with mod_perl you need
to understand that CGI scripts running under mod_perl are effectively
converted in to modules.
You will now see that if two or more CGI scripts try to require
libraries having the same filename (not necessarily the same file)
then only the one that happens to execute first in any given Apache
server thread will work, the others will fail.
There are also problems using relative paths in CGI - at least in
theory. If you only use Apache (and if you are using mod_perl then
that's not much of a restriction) you can rely on Apache setting the
cwd.
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Thu, 15 May 2003 16:42:10 -0400
From: stinkbomb <user@someserver123abc.com>
Subject: handler for CGI file upload and name=value
Message-Id: <3EC3FBA2.72896FC0@someserver123abc.com>
what's a (0r some) way to upload a file and send name=value parameters
in a single CGI submit?
I have an HTML form with a file upload and some text fields and other
fields.
I want to submit the file and text fields and other fields with one
click.
------------------------------
Date: Fri, 16 May 2003 01:01:19 +0300
From: "Arde" <huuhaa@kastema.to>
Subject: Re: handler for CGI file upload and name=value
Message-Id: <3ec40e35$1@news.dnainternet.net>
print $query->startform('POST','savefile.pl','multipart/form-data');
print $query->textfield(-name=>'name',
-default=>'',
-override=>1,
-size=>40,
-maxlength=>255);
print $query->filefield(-name=>'uploaded_file',
-default=>'',
-size=>40,
-maxlength=>255);
print $query->submit(-value=>'Save file', -name=>'send');
"stinkbomb" <user@someserver123abc.com> wrote in message
news:3EC3FBA2.72896FC0@someserver123abc.com...
>
> what's a (0r some) way to upload a file and send name=value parameters
> in a single CGI submit?
>
>
> I have an HTML form with a file upload and some text fields and other
> fields.
> I want to submit the file and text fields and other fields with one
> click.
------------------------------
Date: Thu, 15 May 2003 15:16:10 -0700
From: "Chris" <chris_12003@yahoo.com>
Subject: How to access variable in &login_script for use in main program
Message-Id: <vc81u9gq00na13@corp.supernews.com>
I have a program.cgi that I call &login_script. I'd like to assign a value
to a variable in login_script and use it later in program.cgi. How is this
done?
Thanks,
Chris
------------------------------
Date: Thu, 15 May 2003 21:13:31 +0000
From: aravind741 <member9187@dbforums.com>
Subject: How to pass parameter from CR 8 to Stored Procedure
Message-Id: <2884504.1053033211@dbforums.com>
Hello Gurus
I have a report in CR 8. I have a stored procedure which uses 1
parameter. The stored procedures gets the data required for the report.
Now I want to send the parameter from Crystal report to the Stored
Procedure. How can I do it? I am running this Crystal report from ASP
page where I enter the value for the parameter.
Thanks,
aravind741
--
Posted via http://dbforums.com
------------------------------
Date: Thu, 15 May 2003 12:09:21 -0700
From: Arvin Portlock <apollock11@hotmail.com>
Subject: Re: How to query a Microsoft SQL Server with perl?
Message-Id: <ba0oo9$21pm$1@agate.berkeley.edu>
Cartensy wrote:
> Do I have to use Win32::OLE? Anybody has a exemple of a sample programm
> which connect an MSSQL server and execute un simple query?
>
>
use Win32::OLE;
use Win32::OLE::Const 'Microsoft ActiveX Data Objects';
my $conn = Win32::OLE->new("ADODB.Connection");
my $rs = Win32::OLE->new("ADODB.Recordset");
my $conn->Open (<<EOF);
Provider=sqloledb;
Data Source=mydatasource;
Initial Catalog=dbs;
User Id=Admin;
Password=secret;
EOF
my $sql = "SELECT Title FROM tblBook ORDER BY Title";
$rs->Open($sql, $conn, 1, 1);
until ($rs->EOF) {
my $title = $rs->Fields("Title")->value;
print "$title\n";
$rs->MoveNext;
}
$rs->Close;
$conn->Close;
------------------------------
Date: 15 May 2003 14:27:07 -0700
From: alexander.klosch@web.de (Alexander Klosch)
Subject: HTTP POST & authorization
Message-Id: <b84a29a9.0305151327.544a632d@posting.google.com>
hi,
this scrpit should connect to another script, authenticate at the
server and give back the response. without authentication (disabled
.htaccess) it works.
when .htaccess is enabled i get following error code:
400 (Bad Request) URL must be absolute
but imho I'm using an absolute URI. what am I doin wrong?
thanx alot for help!
kloschi
#!/usr/bin/perl
use LWP;
use HTTP::Request::Common;
use HTTP::Response;
use MIME::Base64;
$ua = LWP::UserAgent->new;
$method = "POST => 'http://domain.tld/cgi-bin/testin.pl'";
$uri = "'http://domain.tld/cgi-bin/testin.pl'";
$user = "user";
$pass = "pasword";
$encoded = encode_base64('$user:$pass');
$head = HTTP::Headers->new([authorization_basic => '$encoded']);
$content = "Content => [
TYPE => 'ALPHANUM',
TEXT => 'testtext',
]";
$request = HTTP::Request->new($method, $uri, $head, $content);
$response = $ua->request($request);
if ($response->is_success) {
print $response->content;
} else {
print $response->error_as_HTML;
};
------------------------------
Date: Thu, 15 May 2003 17:06:49 -0400
From: stinkbomb <user@someserver123abc.com>
Subject: Re: I know it is a newbie dumb question but the answer is not in the camel
Message-Id: <3EC40169.9E8E36C1@someserver123abc.com>
Confucius say, "he who sleeps with itchy asshole, wakes up with smelly
finger"
oh, I ment: "only dumb question is one not asked", yeah that's it.
Bob wrote:
>
> looked for it every where . . .
>
> why does perl use "=~" for s/// and tr///
> and not just a straight "=' for assign ?
>
> BigBadBob
------------------------------
Date: Thu, 15 May 2003 12:08:04 -0700
From: "Chris" <chris_12003@yahoo.com>
Subject: Perl Debugger
Message-Id: <vc7mtl28d9ateb@corp.supernews.com>
I'm trying to trace code in a perl program. Just need something that will
output a text file showing the file name + line of code thats being executed
for later viewing. Does something like this exist, it doesn't have to write
to a text file but I just need some way of tracing whats being executed.
Thanks,
Chris
------------------------------
Date: Thu, 15 May 2003 13:57:16 -0500
From: Scott Yanoff <yanoff@STOP-SPAMMINGyahoo.com>
Subject: Re: Perl Debugger
Message-Id: <3ec3e30c$0$43855$39cecf19@news.twtelecom.net>
Chris wrote:
> I'm trying to trace code in a perl program. Just need something that will
> output a text file showing the file name + line of code thats being executed
> for later viewing. Does something like this exist, it doesn't have to write
> to a text file but I just need some way of tracing whats being executed.
perl -d <some_script.pl>
Good luck,
--
-Scott
yanoff@STOP-SPAMMINGyahoo.com | http://www.yanoff.org | AOL IM: SAY KJY
------------------------------
Date: 15 May 2003 20:47:47 +0100
From: Brian McCauley <nobull@mail.com>
Subject: Re: Perl Debugger
Message-Id: <u9k7csf0v0.fsf@wcl-l.bham.ac.uk>
Scott Yanoff <yanoff@STOP-SPAMMINGyahoo.com> writes:
> Chris wrote:
> > I'm trying to trace code in a perl program. Just need something that will
> > output a text file showing the file name + line of code thats being executed
> > for later viewing. Does something like this exist, it doesn't have to write
> > to a text file but I just need some way of tracing whats being executed.
>
> perl -d <some_script.pl>
I think you'll get closer with:
PERLDB_OPTS="NonStop AutoTrace" perl -d myscript.pl
--
\\ ( )
. _\\__[oo
.__/ \\ /\@
. l___\\
# ll l\\
###LL LL\\
------------------------------
Date: Thu, 15 May 2003 13:06:21 -0500
From: Dodger <dodger@dodger.org>
Subject: Re: removing spaces in a string
Message-Id: <Xns937C7162DFC05dodgerdodgerorg@216.166.71.239>
On 13 May 2003, William Goedicke <goedicke@goedsole.com> in
news:m3of26eo9u.fsf@mail.goedsole.com said something that resembled:
> Dear Kevin -
>
> kgiles@optonline.net (Kevin) writes:
>
>> how do you remove spaces in a string varaible?
>
> $string =~ s/ //g;
>
The regex can be a little more efficient with s/ +//g
That way if there are twenty in a row it can sub all twenty with nothing
once instead of subbing each one with nothing twenty times.
--
Dodger
------------------------------
Date: 15 May 2003 13:51:19 -0700
From: leftshoe06@yahoo.com (nbh)
Subject: Sorting $array[0]
Message-Id: <37d5958b.0305151251.7d0ccf3f@posting.google.com>
Given
@a1 = qw(17 abc);
@a2 = qw(9 zya);
@a3 = qw(44 asdff);
$array[0] = \@a1;
$array[1] = \@a2;
$array[2] = \@a3;
How to sort $array by the first element and maintain the connection with 17 to abc?
------------------------------
Date: Thu, 15 May 2003 17:02:20 -0400
From: stinkbomb <user@someserver123abc.com>
Subject: Re: Sorting $array[0]
Message-Id: <3EC4005C.88FA690E@someserver123abc.com>
nbh wrote:
>
> Given
>
> @a1 = qw(17 abc);
> @a2 = qw(9 zya);
> @a3 = qw(44 asdff);
>
> $array[0] = \@a1;
> $array[1] = \@a2;
> $array[2] = \@a3;
>
> How to sort $array by the first element and maintain the connection with 17 to abc?
are you thinking of a %hash instead of an @rray?
------------------------------
Date: Thu, 15 May 2003 21:17:44 +0200
From: "Janek Schleicher" <bigj@kamelfreund.de>
Subject: Re: Sorting $array[0]
Message-Id: <pan.2003.05.15.19.17.39.290594@kamelfreund.de>
nbh wrote at Thu, 15 May 2003 13:51:19 -0700:
> @a1 = qw(17 abc);
> @a2 = qw(9 zya);
> @a3 = qw(44 asdff);
>
> $array[0] = \@a1;
> $array[1] = \@a2;
> $array[2] = \@a3;
>
>
>
> How to sort $array by the first element and maintain the connection with 17 to abc?
my @sorted = sort {$a->[0] <=> $b->[0]} @array;
Greetings,
Janek
------------------------------
Date: Thu, 15 May 2003 16:58:57 -0400
From: stinkbomb <user@someserver123abc.com>
Subject: Re: Why do I get double line feeds
Message-Id: <3EC3FF91.2967818@someserver123abc.com>
you probably want to give us a little more info. like what
$used_timein[$j] looks like or what
@used_timein looks like.
Travis wrote:
>
> print MEMCHK "$used_timein[$j]\n";
>
> I am writing to file and simply want to get each line with a single line
> feed.
>
> For some reason I get the single line feed when I leave off the \n and I get
> a double line feed when
> I leave it in?
>
> Any ideas?
------------------------------
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 4989
***************************************