[29301] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 545 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jun 21 09:09:55 2007

Date: Thu, 21 Jun 2007 06:09:09 -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, 21 Jun 2007     Volume: 11 Number: 545

Today's topics:
        Adding to a perl script automatically <MMWJones@googlemail.com>
    Re: Adding to a perl script automatically <josef.moellers@fujitsu-siemens.com>
    Re: Adding to a perl script automatically <MMWJones@googlemail.com>
    Re: Assigning another filehandle to STDOUT, using binmo <a24061@ducksburg.com>
    Re: date parts in one step <rvtol+news@isolution.nl>
    Re: date parts in one step anno4000@radom.zrz.tu-berlin.de
    Re: date parts in one step <dummy@example.com>
    Re: date parts in one step anno4000@radom.zrz.tu-berlin.de
        DBD::AnyData hangs when exporting XML  KomsBomb@hotmail.com
    Re: looking to prototype a grammar need suggestions. <grehom@ntlworld.com>
    Re: Passing hash to another script via commandline <joe@inwap.com>
    Re: Passing hash to another script via commandline <purlgurl@purlgurl.net>
    Re: perl and  php <pm3e@juno.com>
    Re: perl and php <pm3e@juno.com>
    Re: Perl Best Practices - Code Formatting. <bugbear@trim_papermule.co.uk_trim>
        SSH plus tail -f without key exchange possible? <jrpfinch@gmail.com>
    Re: SSH plus tail -f without key exchange possible? anno4000@radom.zrz.tu-berlin.de
    Re: SSH plus tail -f without key exchange possible? <jrpfinch@gmail.com>
    Re: Storing Object in DBM Hash anno4000@radom.zrz.tu-berlin.de
    Re: The Modernization of Emacs <bohnenkamp@mevisbreastcare.de>
    Re: The Modernization of Emacs <bohnenkamp@mevisbreastcare.de>
    Re: The Modernization of Emacs anno4000@radom.zrz.tu-berlin.de
    Re: The Modernization of Emacs <kwutzke@web.de>
    Re: The Modernization of Emacs <notbob@nothome.com>
    Re: The Modernization of Emacs <martin@see.sig.for.address>
    Re: Trying to make sense of perl for web development. <paduille.4061.mumia.w+nospam@earthlink.net>
    Re: Trying to make sense of perl for web development. <mritty@gmail.com>
    Re: Trying to make sense of perl for web development. <cendrizzi@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 21 Jun 2007 03:20:59 -0700
From:  "MMWJones@googlemail.com" <MMWJones@googlemail.com>
Subject: Adding to a perl script automatically
Message-Id: <1182421259.377292.243820@p77g2000hsh.googlegroups.com>

Hi,

I have a perl cgi script which defines popup_menu and values in the
drop down list. More values may be added to this over time. People
that don't know much about the script might not want to enter the
script and type in values 'manually'.

Is there a way of writing a script that will ask the user for a value
and be able to access the script and put the value in the correct
place automatically?

If so how would i go about doing this? In a .pl script or .sh script?

Thanks,

Matt



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

Date: Thu, 21 Jun 2007 12:29:48 +0200
From: Josef Moellers <josef.moellers@fujitsu-siemens.com>
Subject: Re: Adding to a perl script automatically
Message-Id: <f5djuv$kt$1@nntp.fujitsu-siemens.com>

MMWJones@googlemail.com wrote:
> Hi,
>=20
> I have a perl cgi script which defines popup_menu and values in the
> drop down list. More values may be added to this over time. People
> that don't know much about the script might not want to enter the
> script and type in values 'manually'.
>=20
> Is there a way of writing a script that will ask the user for a value
> and be able to access the script and put the value in the correct
> place automatically?
>=20
> If so how would i go about doing this? In a .pl script or .sh script?

As far as this operation is concerned, your Perl CGI script is just a=20
plain text file where you want to add some text. Depending upon the=20
structure of the script, this may be a very difficult task or it may be=20
an easy task.
First of all, you may want to modify your Perl CGI script such that=20
adding the relevant entries is easy, e.g. put the entries into an array=20
and add a marker:
my @menu =3D (
     'Entry 1',
     'Entry 2',
     :
     'Entry n',
     # Add new entries for menu here
);
Use this array when constructing your CGI menu.

Then, use whatever language you're familiar with to insert new entries=20
before the line containint "# Add new entries for menu here"

Just give it a try and if your program doesn't work, show us the code=20
and we can most likely help.
--=20
These are my personal views and not those of Fujitsu Siemens Computers!
Josef M=F6llers (Pinguinpfleger bei FSC)
	If failure had no penalty success would not be a prize (T.  Pratchett)
Company Details: http://www.fujitsu-siemens.com/imprint.html



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

Date: Thu, 21 Jun 2007 03:35:09 -0700
From:  "MMWJones@googlemail.com" <MMWJones@googlemail.com>
Subject: Re: Adding to a perl script automatically
Message-Id: <1182422109.444662.259290@n60g2000hse.googlegroups.com>

excellent thanks....that will help me get my head around it for now.
I'll see what i can come up with.



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

Date: Thu, 21 Jun 2007 10:24:57 +0100
From: Adam Funk <a24061@ducksburg.com>
Subject: Re: Assigning another filehandle to STDOUT, using binmode.
Message-Id: <9ospk4-em.ln1@news.ducksburg.com>

On 2007-06-20, Joe Smith wrote:

>> Also, why is it necessary to set binmode on OUTPUT every time I open
>> it?
>
> Each open() on a handle is independent of any previous I/O on that
> handle.  What makes you think binmode() would last past any
> explicit (or implicit) close()?

It wasn't obvious to me, but thanks for clarifying that.  I'm still
wondering about a few things, though.

Is using binmode the most correct way to suppress those annoying "Wide
character" warnings?

Why does Perl act surprised by UTF-8 characters in the output when I'm
running the program with LANG=en_GB.UTF-8 in the environment?

Thanks,
Adam


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

Date: Thu, 21 Jun 2007 11:14:59 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: date parts in one step
Message-Id: <f5dmk5.1e0.1@news.isolution.nl>

Petr Vileta schreef:
> Dr.Ruud:
>> John W. Krahn:
>>> Petr Vileta:

>>>> I need to get month and year values from localtime() so I wrote
>>>> this: # get values in Unix format
>>>> my ($month, $year) = (localtime)[4, 5];
>>>> # convert to human format
>>>> $month++;
>>>> $year += 1900;
>>>> 
>> 
>>  $ perl -wle'
>>    print for map $_+shift,(localtime)[4,5]' 1 1900
>>  '
> 
> Hmm, looks good but I want to use it in script not from commandline.
> Can you rewrite it like this:
> 
> #!/usr/bin/perl
> use strict;
> my ($month, $year) = map .... ;


Simplified description:
Inside a sub, shift works on @_. Outside it works on @ARGV. 

    my @c = (1900, 1); 
    print for map $_ + pop @c, (localtime)[4,5]; 

-- 
Affijn, Ruud

"Gewoon is een tijger."


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

Date: 21 Jun 2007 10:13:38 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: date parts in one step
Message-Id: <5dv1aiF36ms9vU2@mid.dfncis.de>

Paul Lalli  <mritty@gmail.com> wrote in comp.lang.perl.misc:
> On Jun 20, 12:28 pm, "Petr Vileta" <sto...@practisoft.cz> wrote:
> > I need to get month and year values from localtime() so I wrote this:
> >
> > # get values in Unix format
> > my ($month, $year) = (localtime)[4, 5];
> > # convert to human format
> > $month++;
> > $year += 1900;
> >
> > Is possible to do the same in one step?

[...]

> my ($m, $y) = ((localtime)[4] + 1, (localtime)[5] + 1900);

> ...The second requires two
> separate calls to localtime.

Not necessarily (untested):

($m, $y) = ($_->[ 4] + 1, $_->[ 5] + 1900) for [localtime];

You can't declare $x and $y in the same statement anymore.

Anno


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

Date: Thu, 21 Jun 2007 12:13:00 GMT
From: "John W. Krahn" <dummy@example.com>
Subject: Re: date parts in one step
Message-Id: <gXtei.4672$tB5.3810@edtnps90>

anno4000@radom.zrz.tu-berlin.de wrote:
> Paul Lalli  <mritty@gmail.com> wrote in comp.lang.perl.misc:
>> On Jun 20, 12:28 pm, "Petr Vileta" <sto...@practisoft.cz> wrote:
>>> I need to get month and year values from localtime() so I wrote this:
>>>
>>> # get values in Unix format
>>> my ($month, $year) = (localtime)[4, 5];
>>> # convert to human format
>>> $month++;
>>> $year += 1900;
>>>
>>> Is possible to do the same in one step?
> 
> [...]
> 
>> my ($m, $y) = ((localtime)[4] + 1, (localtime)[5] + 1900);
> 
>> ...The second requires two
>> separate calls to localtime.
> 
> Not necessarily (untested):
> 
> ($m, $y) = ($_->[ 4] + 1, $_->[ 5] + 1900) for [localtime];
> 
> You can't declare $x and $y in the same statement anymore.

Sure you can, just replace the for statement modifier with map:

my ($m, $y) = map { $_->[ 4] + 1, $_->[ 5] + 1900 } [localtime];




John
-- 
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order.                            -- Larry Wall


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

Date: 21 Jun 2007 12:20:15 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: date parts in one step
Message-Id: <5dv8nvF36efekU1@mid.dfncis.de>

John W. Krahn <krahnj@telus.net> wrote in comp.lang.perl.misc:
> anno4000@radom.zrz.tu-berlin.de wrote:
> > Paul Lalli  <mritty@gmail.com> wrote in comp.lang.perl.misc:
> >> On Jun 20, 12:28 pm, "Petr Vileta" <sto...@practisoft.cz> wrote:
> >>> I need to get month and year values from localtime() so I wrote this:
> >>>
> >>> # get values in Unix format
> >>> my ($month, $year) = (localtime)[4, 5];
> >>> # convert to human format
> >>> $month++;
> >>> $year += 1900;
> >>>
> >>> Is possible to do the same in one step?
> > 
> > [...]
> > 
> >> my ($m, $y) = ((localtime)[4] + 1, (localtime)[5] + 1900);
> > 
> >> ...The second requires two
> >> separate calls to localtime.
> > 
> > Not necessarily (untested):
> > 
> > ($m, $y) = ($_->[ 4] + 1, $_->[ 5] + 1900) for [localtime];
> > 
> > You can't declare $x and $y in the same statement anymore.
> 
> Sure you can, just replace the for statement modifier with map:
> 
> my ($m, $y) = map { $_->[ 4] + 1, $_->[ 5] + 1900 } [localtime];

Oh dear, yes :)

Anno


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

Date: Thu, 21 Jun 2007 02:06:38 -0700
From:  KomsBomb@hotmail.com
Subject: DBD::AnyData hangs when exporting XML
Message-Id: <1182416798.396853.185560@i38g2000prf.googlegroups.com>

Perl 5.8.0
Newest DBD::AnyData and AnyData just downloaded from CPAN.
When export a test database to xml, the script hangs and seems
it's in a dead loop.


********My Code start*************
use strict;
use warnings;
use DBI;

my $dbh = DBI->connect('dbi:AnyData(RaiseError=>1):');
my ($table, $format, $file, $flags) = (
	'test', 'XML', 'cars.csv', { col_names => 'make,model,year' }
);
$dbh->do("CREATE TABLE test (id TEXT,phrase TEXT)");
$dbh->do("INSERT INTO test VALUES (1,'foonadfjlsdj')");
$dbh->do("INSERT INTO test VALUES (2,'bar')");
$dbh->func( $table, $format, $file, 'ad_export'); #hangs here
********My Code end*************


By doing more investigation, I found where it hangs,

In package AnyData (note not the DBD::AnyData), line 639, in sub
adConvert, there is a line
"        @cols = @{ shift @{ $source_data  } };"
When I execute step by step there, the program hangs at that line.

Any one got such problem? Is it a bug in Perl?
How to solve it?

PS: I've also tested CSV format and it's OK. No any problem.



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

Date: Thu, 21 Jun 2007 01:19:23 -0700
From:  Grehom <grehom@ntlworld.com>
Subject: Re: looking to prototype a grammar need suggestions.
Message-Id: <1182413963.044346.324540@o61g2000hsh.googlegroups.com>

On 20 Jun, 14:44, bpatton <bpat...@ti.com> wrote:
> I do regression testing for rule sets of IC layout verification.
> The current rule sets are written in a doc file in complete free form
> and useless to try and parse.  Different people say the same thing in
> different words.
> I'm looking to create a prototype grammar for describing the rules.
> The majority will be very simple, others will be quite complex and
> contain many pseudo layers.  Here's a couple of examples and some
> explanation
>
> CONT size = 100 x 100
> MET1 overlap CONT = 50
> BOGUS = CONT common to MET1  <-- psuedo layer  created from the "and"
> of 2 other layers that may or may not be pseudo layers
>
> I've already done some data generation on by simply calling a routine
> sub common(layer1,layer2,width,height) {
> draw something
>
> }
>
> This is simple and too limited.  At the very bottom this routine will
> have to exist, it's the calling of this routine. making the decisions
> on which routines to call and in what order.  I've considered CLIPS
> but the problem still exists, no matter what language or platform.
> How to describe a rule in a strict grammer so that a computer language
> can break it apart and act upon the grammar according to the order and
> specific words.
>
> I'm thinking that I need to have a list of
> Noun    -> layer and pseudo layer names  (CONT,MET1,BOGUS)
> verb        -> denotes an action   ( overlap, extends into,
> touching ,...)
> adjective  -> to modify a noun or pronoun
> pronoun   -> substitutes for a noun or noun phrase with or without a
> determiner, such as you and they
>
> The idea is to supply a set of values for each of the 4 grammar
> categories and use only these to describe the rules.
> The nouns are the only section that is eligible to grow by the rule
> coder.
>
> >From this controlled grammar, I would then generate layout data to the
>
> specifications of the grammer

In my opinion you could do a lot worse than by taking a look at Damian
Conway's 'Parse::RecDescent'.  I'm certainly no rocket scientist, but
I find this grammar very useful where I want to do a bit more than I
can comfortably manage using regexps.



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

Date: Thu, 21 Jun 2007 00:59:25 -0700
From: Joe Smith <joe@inwap.com>
Subject: Re: Passing hash to another script via commandline
Message-Id: <YcGdnazxoMtDsufbnZ2dnUVZ_sOknZ2d@comcast.com>

Purl Gurl wrote:

> Irrelevant. Your comments do not comply with the originating
> author's stated parameters.

You're assuming that the author's stated parameters are the only
parameters that he is ever going to use.  Bad assumption.

A competent programmer provides solutions that work in the general
case, not just the case with "field1 => 'f1val', field2 => 'f2val'".

	-Joe


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

Date: Thu, 21 Jun 2007 04:21:33 -0700
From: Purl Gurl <purlgurl@purlgurl.net>
Subject: Re: Passing hash to another script via commandline
Message-Id: <a5CdnWZB2aOjwufbnZ2dnUVZ_rKvnZ2d@giganews.com>

Joe Smith wrote:

> Purl Gurl wrote:

>> Irrelevant. Your comments do not comply with the originating
>> author's stated parameters.

> You're assuming that the author's stated parameters are the only
> parameters that he is ever going to use.  Bad assumption.

> A competent programmer provides solutions that work in the general
> case, not just the case with "field1 => 'f1val', field2 => 'f2val'".

Oh look! Another stringless yo-yo childish troll. Hooray!
We all love idiocy within a technology discussion group!

Inform readers, you troll boy, what are the originating author's
complete set of possible parameters. Put to good use your fantastic
internet mind reading skills, read the author's mind then inform
all of us, precisely and exactly all possible data for which we
should prepare through code.

* slips on her Johnny Carson swami turban *

Wait! Wait! I have created a socket directly the author's sleeping mind....

I see... I see... OH MY! Sometimes his data will be one-hundred gigabytes
of pure binary data. OH NO! Sometimes his data will be a letter "E" followed
by ten-million spaces, then a letter "I" followed by twenty-million spaces,
then the letter "E" followed by one space, then another letter "I" followed
by ten-million-one-hundred-billion spaces, then the letters "OOOOH" followed
by an exclamation mark!

E I E I OOOOH!

Goodness, the author is dreaming about Old McDonald's Farm.

Listen you blithering babblers, you do not have a single clue
on this. You are piss poor programmers, piss poor Perl code writers
and exceptionally piss poor thinkers.

How the Hades could you childish twits have the slightest hint
of what data to expect beyond what is concisely stated by an
author? You do not. "Bad assumption" my smelly foot. I have made
no bad assumption by restricting my code to only those parameters
stated. No bad assumption here, I am simply dealing with a bunch of
stringless yo-yo boys who know diddly-squat about programming and
yet think themselves Gods of Perl.

* SCREAMS *

Such stupidity!

Only bad assumption made is you dumb boys arrogantly assuming all
readers to be so gullible to fall for your idiocy.

Hey! Take your stupid "what if" troll games and shove those games
right up there with your heads.

-- 
Purl Gurl
--
"Then again what can you expect from a fat-assed, champagne swilling,
  half-breed just off the Rez?"
   - Joe Kline


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

Date: Thu, 21 Jun 2007 11:55:38 GMT
From: peter <pm3e@juno.com>
Subject: Re: perl and  php
Message-Id: <_Gtei.34160$Um6.17029@newssvr12.news.prodigy.net>

peter wrote:
> Hi,
> 
> this is not stinky bait.  If you take it that way, please dont respond..
> 
> I have been away from UNIX software for quite awhile and want to get 
> back into it.  I liked "C" but Java seems like the way to go for 
> compiled langs, now days so I will learn that.
> 
> At one time, I did a bit of perl but now I see php alot.  I was 
> wondering what you guys thinks of the pros/cons of  perl and php.
> 
> I appreciate your time,
> peter

Hi guys,

I havent looked at this thread for a week...the php ng stopped posting a 
long time ago...i think i much prefer the discourse and nuance of 
perl...you shall be hearing from me again.  :)

thanks,
peter


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

Date: Thu, 21 Jun 2007 07:55:41 -0400
From: peter <pm3e@juno.com>
Subject: Re: perl and php
Message-Id: <eBtei.5670$c06.4403@newssvr22.news.prodigy.net>

Emmanuel Florac wrote:
  You know the best tool isn't
> the more common, actually most common tools ( Windows, Java, PHP ) usually
> suck more :) "100 billions flies eat shit, why shouldn't we?"
> 
hehehe,
thats why i like UNIX :)


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

Date: Thu, 21 Jun 2007 09:42:45 +0100
From: bugbear <bugbear@trim_papermule.co.uk_trim>
Subject: Re: Perl Best Practices - Code Formatting.
Message-Id: <467a3a06$0$8724$ed2619ec@ptn-nntp-reader02.plus.net>

Asim Suter wrote:
> 
> I know people feel strongly about code layout/format and "bracing 
> technology" - I would like to know
> what folks are using in their scripts and modules.
> 
> I am talking about production scripts and modules ( possibly multiple people 
> team ) with sufficient complexity.
> ( Several thousand Perl line count at the minimum )
> 
> Which style appeals to you more and which one do you use ?

In the age of internet powered code reuse (e.g. CPAN
and this group) I would adopt whatever the majority
have already adopted, even if I didn't like it.

Standardisation trumps beauty in this instance, I feel.

Editing/Reading/Working with multiple
conventions is just head picking and frustrating.

   BugBear


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

Date: Thu, 21 Jun 2007 03:16:45 -0700
From:  jrpfinch <jrpfinch@gmail.com>
Subject: SSH plus tail -f without key exchange possible?
Message-Id: <1182421005.996156.247980@k79g2000hse.googlegroups.com>

I would like to tail -f a file on a remote machine over SSH and
process output line-by-line as it comes in.  I'm pretty sure this can
be done using Expect  and open (FH, "ssh root@remote_machine ... tail -
f |") if you have exchanged keys.  ssh will not take a supplied
username and password on the command line, however.

This leaves Net::SSH::Perl, which does accept user/pass login, but
AFAIK only lets you issue discrete commands via the '->cmd("ls -ltr")'
method.

Any hints appreciated.  Otherwise I'm just going to examine the file
size at discrete intervals and use tail -[some number] to get the
output if the file size has changed.  This does not seem to be an
efficient solution.

Many thanks

Jon



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

Date: 21 Jun 2007 10:44:29 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: SSH plus tail -f without key exchange possible?
Message-Id: <5dv34dF35upcrU1@mid.dfncis.de>

jrpfinch  <jrpfinch@gmail.com> wrote in comp.lang.perl.misc:
> I would like to tail -f a file on a remote machine over SSH and
> process output line-by-line as it comes in.  I'm pretty sure this can

Have you seen the FAQ 'How do I do a "tail -f" in perl?' ?

Anno


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

Date: Thu, 21 Jun 2007 04:25:08 -0700
From:  jrpfinch <jrpfinch@gmail.com>
Subject: Re: SSH plus tail -f without key exchange possible?
Message-Id: <1182425108.730404.29730@p77g2000hsh.googlegroups.com>

>
> Have you seen the FAQ 'How do I do a "tail -f" in perl?' ?
>

Yes I have but don't see how you can combine this with ssh.  AFAIK you
can't combine this with Net::SSH::Perl because it only returns output
when a command has finished running (i.e. you can only execute
discrete commands).  If there is a way, then I would be grateful to
know - I must have overlooked something.



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

Date: 21 Jun 2007 12:56:39 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: Storing Object in DBM Hash
Message-Id: <5dvas7F35fkmmU1@mid.dfncis.de>

 <michael.shnitzer@gmail.com> wrote in comp.lang.perl.misc:
> Why would the following code work in a regular hash environment but
> dereference when using a DBM hash?

The values of DBM-Tied hashes can only be plain scalars, not references.  
After all, references are live addresses in the current program, unfit
to be stored to disk.

CPAN has MLDBM (where ML stands for Multi Level) which deals with
that problem.  There may be newer modules for the same purpose.

Anno


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

Date: Thu, 21 Jun 2007 09:56:19 +0200
From: Sascha Bohnenkamp <bohnenkamp@mevisbreastcare.de>
Subject: Re: The Modernization of Emacs
Message-Id: <5dup93F35nekiU1@mid.individual.net>

E M A C S
i e n o w
g g d n a
h a   t p
t b   i p
  y   n i
  t   o n
  e   u g
  s   s
      l
  o   y
  f

  m
  e
  m
  o
  r
  y


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

Date: Thu, 21 Jun 2007 09:57:37 +0200
From: Sascha Bohnenkamp <bohnenkamp@mevisbreastcare.de>
Subject: Re: The Modernization of Emacs
Message-Id: <5dupbhF35nekiU2@mid.individual.net>

> Windows text editors are not normal: most are devoid of all but the most
> primitive functions and are further hampered by having an interface that
> required frequent time wasting hand transfers from keyboard to mouse
> because, if they provide keyboard equivalents at all, these are
> remarkably unmemorable and/or undocumented.

well ultra-edit, textpad, source-insight etc. pp are better than that
(and run on windows)


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

Date: 21 Jun 2007 09:51:52 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: The Modernization of Emacs
Message-Id: <5dv01oF36ms9vU1@mid.dfncis.de>

Dave Hansen  <iddw@hotmail.com> wrote in comp.lang.perl.misc:

> Speaking of which, vi is a piece of wombat do.  ;-)

You can have Emacs when you pry it from my cold hypertrophied
escape-pressing pinky!

Anno


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

Date: Thu, 21 Jun 2007 04:44:39 -0700
From:  Karsten Wutzke <kwutzke@web.de>
Subject: Re: The Modernization of Emacs
Message-Id: <1182426279.720855.246350@u2g2000hsc.googlegroups.com>

On 17 Jun., 17:13, Xah Lee <x...@xahlee.org> wrote:

Yaawn!

>   Xah
>   x...@xahlee.org
> =E2=88=91http://xahlee.org/

Hmm I just had to think about the C64/Amiga etc. game "California
Games"... The game displayed a comment when the player broke his neck
the 13th time when BMXing:

"Geek of the week!"

Karsten



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

Date: Thu, 21 Jun 2007 07:49:25 -0500
From: notbob <notbob@nothome.com>
Subject: Re: The Modernization of Emacs
Message-Id: <qOidnVeqp95I7ufbnZ2dnUVZ_tWdnZ2d@comcast.com>

On 2007-06-21, anno4000@radom.zrz.tu-berlin.de <anno4000@radom.zrz.tu-berlin.de> wrote:

> You can have Emacs when you pry it from my cold hypertrophied
> escape-pressing pinky!

LOL!....

nb


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

Date: Thu, 21 Jun 2007 13:06:15 +0100
From: Martin Gregorie <martin@see.sig.for.address>
Subject: Re: The Modernization of Emacs
Message-Id: <p66qk4-d23.ln1@zoogz.gregorie.org>

Sascha Bohnenkamp wrote:
>> Windows text editors are not normal: most are devoid of all but the most
>> primitive functions and are further hampered by having an interface that
>> required frequent time wasting hand transfers from keyboard to mouse
>> because, if they provide keyboard equivalents at all, these are
>> remarkably unmemorable and/or undocumented.
> 
> well ultra-edit, textpad, source-insight etc. pp are better than that
> (and run on windows)

I said MOST, not all!

To your list I'd add PFE and a Windows port of microEmacs, which has 
almost nothing in common with EMACS except some key bindings.

But to return to your point: how many Windows users actually install the 
editors we've listed? I bet most never get past Wordpad. I've even found 
  people using Word, of all things, to edit BAT files and program source.

I'd give long odds that Windows users who use editors other than Wordpad 
are using the one that came with whatever IDE they've installed, simply 
because integrated editors are much more common in Windows-only IDEs 
that they are on *nixen. My guess is that this is because the standard 
editors (Wordpad, edlin) are so bad.


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |


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

Date: Thu, 21 Jun 2007 08:03:14 GMT
From: "Mumia W." <paduille.4061.mumia.w+nospam@earthlink.net>
Subject: Re: Trying to make sense of perl for web development.
Message-Id: <6hqei.1882$iz5.422@newsread4.news.pas.earthlink.net>

On 06/20/2007 11:27 PM, cendrizzi wrote:
> Ok, I'm trying to learn perl for a potential position.
> 
> I would consider myself a very experienced php programmer with a
> little exposure to perl.
> 
> As far as syntax goes, perl seems pretty easy (some things I even like
> a lot).  I have an ubuntu feistry server that I've setup with
> mod_perl.  It works great for parsing simple stuff but now I'm ready
> to extend the functionality a bit and want to connect to postgresql,
> etc.
> 
> Admittedly this is more a systems things than a programming thing but
> I need to get things in place so I can program and learn.  First of
> all, how does mod perl work with the cpan packages?  When I install
> something using cpan should I be able to use that module (ie "use
> module::module") immediately after?  

If you use the ModPerl::Registry handler, you probably have to restart 
the web server. ModPerl::PerlRun will probably be more flexible and 
recognize newly installed modules without requiring a server restart.

I'm not sure of this--test it.

> So far that has not been my
> experience.  Furthermore, can I use the cgi stuff in cpan when I'm
> using mod_perl, like cgi::ajax??  

Mod_perl attempts to emulate a CGI environment, but it's not perfect. I 
haven't used CGI::Ajax, but it may be one of the CGI modules that hasn't 
been changed to suit mod_perl.

> I've just never had to deal with all
> this with php so it's feeling very overwhelming in how it all works
> together (I'm trying to read books and have been googling for hours to
> make sense of it).
> 
> Finally, and most frustrating is getting error or warning feedback.
> Where do I go?  I currently am trying to connect to my db with:
>  $dbh = DBI->connect("dbi:Pg:dbname=ecommerce;host=127.0.0.1",
> "cendrizzi", "************", {AutoCommit => 0});
> 
> I then try to do stuff with $dbh and nothing happens but I don't get
> errors either.  I have no idea what is going on or if I can even
> successfully connect to the db?!  In PHP you can turn on errors and
> warnings to display them in the page, I'm sure Perl is just
> different.  How can I troubleshoot this stuff?
> 
> Thanks for any help you can provide me with.
> 

Script errors should appear in the Apache error_log. If you want these 
error messages to appear in the browser, use the CGI::Carp module. Read 
the documentation for that module: "perldoc CGI::Carp"






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

Date: Thu, 21 Jun 2007 03:54:27 -0700
From:  Paul Lalli <mritty@gmail.com>
Subject: Re: Trying to make sense of perl for web development.
Message-Id: <1182423267.786737.310910@k79g2000hse.googlegroups.com>

On Jun 21, 12:27 am, cendrizzi <cendri...@gmail.com> wrote:

> Finally, and most frustrating is getting error or warning feedback.
> Where do I go?  I currently am trying to connect to my db with:
>  $dbh = DBI->connect("dbi:Pg:dbname=ecommerce;host=127.0.0.1",
> "cendrizzi", "************", {AutoCommit => 0});
>
> I then try to do stuff with $dbh and nothing happens but I don't
> get errors either.  

You didn't ask for any errors.  Either check the return value of
connect() explicitly:
my $dbh = DBI->connect(...) or die "Connect failed: $DBI::errstr";
or turn on RaiseError
my $dbh = DBI->connect($dsn, $user, $pass, { RaiseError => 1 });

See the DBI documentation.

> I have no idea what is going on or if I can even
> successfully connect to the db?!  In PHP you can turn on errors and
> warnings to display them in the page, I'm sure Perl is just
> different.

You can with Perl as well.  You want the CGI::Carp module, which is
standard in Perl.

use CGI qw/:standard/;
use CGI::Carp qw/fatalsToBrowser warningsToBrowser/;
print header;
warningsToBrowser(1);

Again, see the CGI::Carp documentation.

This would also be a good time to familiarize yourself with the Perl
FAQ.  From a command line, type
perldoc perlfaq
for the full list, or do a search via
perldoc -q <search_term>
For example:

$ perldoc -q CGI
Found in /software/perl-5.8.5-0/pkg/lib/5.8.5/pod/perlfaq3.pod
     How can I get better error messages from a CGI program?

Paul Lalli



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

Date: Thu, 21 Jun 2007 12:54:24 -0000
From:  cendrizzi <cendrizzi@gmail.com>
Subject: Re: Trying to make sense of perl for web development.
Message-Id: <1182430464.041485.285330@a26g2000pre.googlegroups.com>

Wow, thanks guys!

I will do this for sure.  For someone newer to perl it is somewhat
bewildering (and exciting) how many modules exist.  Just looking for
postgres drivers made me feel overwhelmed.

BTW, is mod_perl the best way to go?  It seems from most things I've
read to have some nice advantages.



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

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.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

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 V11 Issue 545
**************************************


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