Re: Another Perl Question

2001-05-24 Thread Piers Cawley

[EMAIL PROTECTED] writes:

> I know, I know, this makes a grand total of three posted to the list in one 
> day :-)
> 
> I have what will usually be a list of objects, but on occasions nasty
> programmers (including me) do things to annoy me like inserting a hashref,
> so I end up with a data structure that looks like:
> 
>   [
> bless({}, 'Some::Class'),
> bless({}, 'Some::Class'),
> {},
> bless({}, 'Some::Class'),
>   ]
> 
> which as expected, makes things go crazy when I try to call a method on
> every object in the list.
> 
> So what I really need is a surefire method to find out if something is blessed,
> rather than just a reference.  I know that I could do a simple regex against
> ref to find out if it is a HASH|ARRAY|SCALAR|CODE|REF|Regex, but a nice simple
> keyword like blessed( $svref ) would be nice.

eval {$ref->isa(UNIVERSAL)} will return true iff $ref is blessed.

-- 
Piers Cawley
www.iterative-software.com




Re: Another Perl Question

2001-05-24 Thread jduncan

On Thu, May 24, 2001 at 04:16:44PM +0100, Richard Clamp wrote:
> On Thu, May 24, 2001 at 04:13:35PM +0100, [EMAIL PROTECTED] wrote:
> > 
> > Any suggestions?
> 
> use Scalar::Util qw( blessed );

that was what I was looking for

--james 


 PGP signature


Re: Another Perl Question

2001-05-24 Thread Richard Clamp

On Thu, May 24, 2001 at 04:13:35PM +0100, [EMAIL PROTECTED] wrote:
> 
> Any suggestions?

use Scalar::Util qw( blessed );

-- 
Richard Clamp <[EMAIL PROTECTED]>



Re: Another Perl Question

2001-05-24 Thread Mike Wyer

On Thu, 24 May 2001 [EMAIL PROTECTED] wrote:

>I know, I know, this makes a grand total of three posted to the list in one
>day :-)
>
>I have what will usually be a list of objects, but on occasions nasty
>programmers (including me) do things to annoy me like inserting a hashref,
>so I end up with a data structure that looks like:
>
>  [
>bless({}, 'Some::Class'),
>bless({}, 'Some::Class'),
>{},
>bless({}, 'Some::Class'),
>  ]
>
>which as expected, makes things go crazy when I try to call a method on
>every object in the list.
>
>So what I really need is a surefire method to find out if something is blessed,
>rather than just a reference.  I know that I could do a simple regex against
>ref to find out if it is a HASH|ARRAY|SCALAR|CODE|REF|Regex, but a nice simple
>keyword like blessed( $svref ) would be nice.

ref

and I quote:

Returns a TRUE value if EXPR is a reference, FALSE otherwise.  If the
referenced object has been blessed into a package, then that package
name is returned instead.

my $wtf = ref $could_be_anything;

if ($wtf) {
if ($wtf eq "HASH") {
# Hash ref

}
else {
# Object
}
}

Cheers,
Mike
-- 
Mike Wyer <[EMAIL PROTECTED]> || "Woof?"
http://www.doc.ic.ac.uk/~mw ||  Gaspode the Wonder Dog
Work:  +44 020 7594 8440||
Mobile: +44 07879 697119||  ICQ: 43922064




Another Perl Question

2001-05-24 Thread jduncan

I know, I know, this makes a grand total of three posted to the list in one 
day :-)

I have what will usually be a list of objects, but on occasions nasty
programmers (including me) do things to annoy me like inserting a hashref,
so I end up with a data structure that looks like:

  [
bless({}, 'Some::Class'),
bless({}, 'Some::Class'),
{},
bless({}, 'Some::Class'),
  ]

which as expected, makes things go crazy when I try to call a method on
every object in the list.

So what I really need is a surefire method to find out if something is blessed,
rather than just a reference.  I know that I could do a simple regex against
ref to find out if it is a HASH|ARRAY|SCALAR|CODE|REF|Regex, but a nice simple
keyword like blessed( $svref ) would be nice.

Any suggestions?

--james 



 PGP signature


Re: [HELP] Quick question about Red Hat and gb keyboards

2001-04-13 Thread Chris Benson

On Fri, Apr 06, 2001 at 11:43:56AM +0200, Merijn Broeren wrote:

> looked with jwz's [1] xkeycaps. Xmodmap seems to make no difference. 

> [1] Correct single quote usage?

Yup  :-) 
-- 
Chris Benson



Re: [HELP] Quick question about Red Hat and gb keyboards

2001-04-06 Thread Leon Brocard

Merijn Broeren sent the following bits through the ether:

> Anybody got an easy answer?

One of the more annoying RH bugs. Just do:

xmodmap -e "keycode 22 = BackSpace"

in a relevant startup script (.bashrc will do).

HTH, Leon
-- 
Leon Brocard.http://www.astray.com/
yapc::Europehttp://yapc.org/Europe/

... Artificial Intelligence is no match for natural stupidity



[HELP] Quick question about Red Hat and gb keyboards

2001-04-06 Thread Merijn Broeren

Hi,

My experience with Red Hat is none existant, and I haven't installed a n
desktop Linux system in ages, so turn to you lot to ask a quick question
about something that isn't immediatley obvious to me. 

If I change in /etc/X11/XF86config the keyboard setting to 'gb' from
'us', the backspace and delete key give me a forward delete.  I don't
care that much since I can't type on a gb keybaord anyway, but one of my
collegues here is much annoyed by the ctrl-H :-) I tried stty erase and
looked with jwz's [1] xkeycaps. Xmodmap seems to make no difference. 

Anybody got an easy answer?


Cheers,
[1] Correct single quote usage?
-- 
Merijn Broeren| Nothing is more poignant in old age than the 
Software Geek | memory of temptation resisted.
  | 



RE: Question

2001-04-04 Thread dcross - David Cross

From: Leon Brocard <[EMAIL PROTECTED]>
Sent: 04 April 2001 10:32

> I guess 3 months experience in Perl programming would mean working for a
> newmedia agency...

ITYM "working for a newmedia agency would give you three months experience
in Perl programming (before it goes bust).

HTH, HAND.

Dave...


The information contained in this communication is
confidential, is intended only for the use of the recipient
named above, and may be legally privileged. If the reader 
of this message is not the intended recipient, you are
hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited.  
If you have received this communication in error, please 
re-send this communication to the sender and delete the 
original message or any copy of it from your computer
system.



Re: Question

2001-04-04 Thread Leon Brocard

james_h sent the following bits through the ether:

> In a (possibly vain) attempt to think ahead, I am looking for some
> info on London-based Perl jobs.  I have about 3/4 months experience
> in Perl programming, and ideally would like to stay in the city
> area.  Anyone know of some good places to start?

Well, posting to this list is always a start, although I doubt
planning far ahead will help. Come to the meeting on Thursday and ask
around then. Otherwise, monster.co.uk and jobsearch.co.uk. I guess 3
months experience in Perl programming would mean working for a
newmedia agency...

HTH, Leon
-- 
Leon Brocard.http://www.astray.com/
yapc::Europehttp://yapc.org/Europe/

... Duh! It's like a totally famous quote!



Question

2001-04-03 Thread james_h

Hi Folks -

In a (possibly vain) attempt to think ahead, I am looking for some info on 
London-based Perl jobs.  I have about 3/4 months experience in Perl 
programming, and ideally would like to stay in the city area.  Anyone know of 
some good places to start?

Thanks

James

--
insert [sig] here
--


---
The Totalise Email system, probably the most flexible email system in the
world. To register for an account goto http://www.totalise.net




Re: Debian question ...

2001-03-24 Thread Marty Pauley

On Thu Mar 22 14:48:48 2001, Marcel Grunauer wrote:
> 
> David Cantrell writes
> 
> >is there an easy way of getting a list of all the packages which are  
> >currently installed?  I dislike dselect intensely, and the docs for   
> >dpkg et al don't say anything useful.
> 
> dpkg -l | grep '^ii'

  dpkg -l | grep '^.i'

is better.  The second char is the current state; the first is the
intended state.  Usually the intended state for installed packages is to
stay installed, but they could be held (status 'hi') to lock them at a
particular version.

-- 
Marty

 PGP signature


Re: Debian question ...

2001-03-22 Thread Simon Cozens

On Thu, Mar 22, 2001 at 01:43:28PM +, David Cantrell wrote:
> is there an easy way of getting a list of all the packages which are
> currently installed?  I dislike dselect intensely, and the docs for
> dpkg et al don't say anything useful.

dpkg -l

-- 
"Life sucks, but it's better than the alternative."
-- Peter da Silva



Re: Debian question ...

2001-03-22 Thread Struan Donald

* at 22/03 14:29 + David Cantrell said:
> mallum and others wrote:
> 
> > dpkg -l
> 
> OK, so how did I manage to miss that?  Answers on a postcard.

i suspect it's the well known phenomona of managing not to read the
one line of the manual that was relevant. 

struan



Re: Debian question ...

2001-03-22 Thread David Cantrell

mallum and others wrote:

> dpkg -l

OK, so how did I manage to miss that?  Answers on a postcard.

-- 
David Cantrell | [EMAIL PROTECTED] | http://www.cantrell.org.uk/david

   The voices said it's a good day to clean my weapons.



Re: Debian question ...

2001-03-22 Thread mallum

on Thu, Mar 22, 2001 at 01:43:28PM +, David Cantrell wrote:
> is there an easy way of getting a list of all the packages which are
> currently installed?  I dislike dselect intensely, and the docs for 
> dpkg et al don't say anything useful.
> 
> -- 

dpkg -l

Useful page;

http://www.spack.org/geek/apt-help.html

mallum



Re: Debian question ...

2001-03-22 Thread Roger Burton West

On or about Thu, Mar 22, 2001 at 02:48:48PM +, Marcel Grunauer typed:

>dpkg -l | grep '^ii'

Will truncate long package names.

Roger



Re: Debian question ...

2001-03-22 Thread Roger Burton West

On or about Thu, Mar 22, 2001 at 01:43:28PM +, David Cantrell typed:
>is there an easy way of getting a list of all the packages which are
>currently installed?  I dislike dselect intensely, and the docs for 
>dpkg et al don't say anything useful.

   To make a local copy of the package selection states:
dpkg --get-selections >myselections

Roger



Re: Debian question ...

2001-03-22 Thread Marcel Grunauer


David Cantrell writes

>is there an easy way of getting a list of all the packages which are  
>currently installed?  I dislike dselect intensely, and the docs for   
>dpkg et al don't say anything useful.

dpkg -l | grep '^ii'

Marcel

-- 
We are Perl. Your table will be assimilated. Your waiter will adapt to
service us. Surrender your beer. Resistance is futile.
 -- London.pm strategy aka "embrace and extend" aka "mark and sweep"



Debian question ...

2001-03-22 Thread David Cantrell

is there an easy way of getting a list of all the packages which are
currently installed?  I dislike dselect intensely, and the docs for 
dpkg et al don't say anything useful.

-- 
David Cantrell | [EMAIL PROTECTED] | http://www.cantrell.org.uk/david

   The voices said it's a good day to clean my weapons.



Re: xemacs / cperl question

2001-03-19 Thread jduncan

On Mon, Mar 19, 2001 at 06:23:27PM +, James Powell wrote:
> Anyone know how to stop xemacs cperl-mode to stop knackering it's 
> auto-tab indentation after you confuse it with a line like
> 
> my $dbh = ${$self->{params}->{dbh}};
> 
> (doesn't seem to like the curly braces).

  my $dbh = $ {$self->{params}->{dbh}} I think is the only way to do it --
it seems to think that the variable is '${' thus the terminating bracket
clobbers its count.

--james.

 PGP signature


xemacs / cperl question

2001-03-19 Thread James Powell

Anyone know how to stop xemacs cperl-mode to stop knackering it's 
auto-tab indentation after you confuse it with a line like

my $dbh = ${$self->{params}->{dbh}};

(doesn't seem to like the curly braces).



jp



Re: TT2 Question

2001-02-08 Thread Struan Donald

* at 08/02 13:00 -0500 Andy Williams said:
> I'm installing TT2.
> The problem. the installation says that I need XML::DOM ver 1.27
> installed
> 
> I've hunted high and low but all I can find is version 1.25!
> 
> Anyone know where I can get it?

libxml-enno is what you want.

struan



TT2 Question

2001-02-08 Thread Andy Williams

I'm installing TT2.
The problem. the installation says that I need XML::DOM ver 1.27
installed

I've hunted high and low but all I can find is version 1.25!

Anyone know where I can get it?

TIA

Andy



"Pub: ah, yes, a meeting place where people attempt to reach
advanced states of mental incompetence by the repeated
consumption of fermented vegetable drinks"






Re: CGI.pm Question

2001-01-30 Thread Andy Williams


> You can't properly - I think there is a rant on :
>
> http://ppewww.ph.gla.ac.uk/~flavell/www/
>
> about this matter but I dont have the time to check the whole lot.  The
> best way to achieve the effect is to use LWP to submit the request and
> then display the resulting output.
>
> This might answer:
>
>http://ppewww.ph.gla.ac.uk/~flavell/www/post-redirect.html
>

Thanks Jonathon.

It appears that it'll only work if all my users have Lynx 2.8.3. (I
can dream I suppose.)

Just added another page to the mix that auto submits on load, and that
seems to work.

Andy




Re: CGI.pm Question

2001-01-30 Thread Jonathan Stowe

On Tue, 30 Jan 2001, Andy Williams wrote:

> Hi,
>
> I know how to redirect using the GET method
>   print $q->redirect("$url?$query_string");
> but how do I do it for POST?
>

You can't properly - I think there is a rant on :

http://ppewww.ph.gla.ac.uk/~flavell/www/

about this matter but I dont have the time to check the whole lot.  The
best way to achieve the effect is to use LWP to submit the request and
then display the resulting output.

This might answer:

   http://ppewww.ph.gla.ac.uk/~flavell/www/post-redirect.html

/J\
-- 
Jonathan Stowe   |
http://www.gellyfish.com |   I'm with Grep on this one
http://www.tackleway.co.uk   |




CGI.pm Question

2001-01-30 Thread Andy Williams

Hi,

I know how to redirect using the GET method
print $q->redirect("$url?$query_string");
but how do I do it for POST?

TIA

Andy



"This sounds like a twelve-change-of-underwear trip."






Re: Dumb-assed question

2001-01-25 Thread Struan Donald

* at 25/01 11:26 + James Powell said:
> On Thu, Jan 25, 2001 at 11:05:49AM +, Struan Donald wrote:
> > * at 25/01 10:37 + Michael Stevens said:
> > > On Wed, Jan 24, 2001 at 06:02:25PM +, [EMAIL PROTECTED] wrote:
> > > >   Dreamweaver (I know, don't ask) nicely escapes the spaces to %20 but when
> > > >   I try and download these, the %20 appears in the Netscape file save as 
>box
> > > >   instead of spaces.
> > > 
> > > Dreamweaver is by far the best GUI html development tool I'm aware of.
> > 
> > the number of times i've sent stuff to people that works fine, had
> > them run it through dreamweaver and then complain that it's broken
> > makes me wonder what the bad gui tools are like. 
> > 
> > struan
> 
> Waiter, a copy of Frontpage 2000 for the gentleman!

thank you, no.

struan



Re: Dumb-assed question

2001-01-25 Thread James Powell

On Thu, Jan 25, 2001 at 11:05:49AM +, Struan Donald wrote:
> * at 25/01 10:37 + Michael Stevens said:
> > On Wed, Jan 24, 2001 at 06:02:25PM +, [EMAIL PROTECTED] wrote:
> > >   Dreamweaver (I know, don't ask) nicely escapes the spaces to %20 but when
> > >   I try and download these, the %20 appears in the Netscape file save as box
> > >   instead of spaces.
> > 
> > Dreamweaver is by far the best GUI html development tool I'm aware of.
> 
> the number of times i've sent stuff to people that works fine, had
> them run it through dreamweaver and then complain that it's broken
> makes me wonder what the bad gui tools are like. 
> 
> struan

Waiter, a copy of Frontpage 2000 for the gentleman!


jp



Re: Dumb-assed question

2001-01-25 Thread Michael Stevens

On Thu, Jan 25, 2001 at 11:05:49AM +, Struan Donald wrote:
> the number of times i've sent stuff to people that works fine, had
> them run it through dreamweaver and then complain that it's broken
> makes me wonder what the bad gui tools are like. 

Much much worse. Trust me on this.

Michael



Re: Dumb-assed question

2001-01-25 Thread Struan Donald

* at 25/01 10:37 + Michael Stevens said:
> On Wed, Jan 24, 2001 at 06:02:25PM +, [EMAIL PROTECTED] wrote:
> >   Dreamweaver (I know, don't ask) nicely escapes the spaces to %20 but when
> >   I try and download these, the %20 appears in the Netscape file save as box
> >   instead of spaces.
> 
> Dreamweaver is by far the best GUI html development tool I'm aware of.

the number of times i've sent stuff to people that works fine, had
them run it through dreamweaver and then complain that it's broken
makes me wonder what the bad gui tools are like. 

struan



Re: Dumb-assed question

2001-01-25 Thread Dave Cross

At Thu, 25 Jan 2001 10:37:07 +, Michael Stevens <[EMAIL PROTECTED]> wrote:

> Dreamweaver is by far the best GUI html development tool I'm aware of.

Maybe, but calling something the 'best' in that product category is
probably damning with faint praise.

Dave...



Re: Dumb-assed question

2001-01-25 Thread Michael Stevens

On Wed, Jan 24, 2001 at 06:02:25PM +, [EMAIL PROTECTED] wrote:
>   Dreamweaver (I know, don't ask) nicely escapes the spaces to %20 but when
>   I try and download these, the %20 appears in the Netscape file save as box
>   instead of spaces.

Dreamweaver is by far the best GUI html development tool I'm aware of.

Michael



Re: Dumb-assed question

2001-01-24 Thread Robin Houston

On Wed, Jan 24, 2001 at 12:42:58PM -0600, Paul Makepeace wrote:
> 
> Exercise: Implement the "except the last" in a regex :-)
> Extra points for squeezing it into a single regex rather than
> a while / $' solution


s/\.(?=.*\.)/_/g;

 .robin.

-- 
Are we not drawn onward, we few, drawn onward to new era?



Re: Dumb-assed question

2001-01-24 Thread Paul Makepeace

On Wed, Jan 24, 2001 at 06:17:45PM +, Robin Houston wrote:
> I suppose you were hoping for a simpler procedure, but this is
> the simplest I've found. Possibly IE doesn't have that problem.

It has others, it'll s/\./_/g for all except the last.

Exercise: Implement the "except the last" in a regex :-)
Extra points for squeezing it into a single regex rather than
a while / $' solution

Paul



Re: Dumb-assed question

2001-01-24 Thread Robin Houston

On Wed, Jan 24, 2001 at 06:02:25PM +, [EMAIL PROTECTED] wrote:
> 
>   Dreamweaver (I know, don't ask) nicely escapes the spaces to
>   %20 but when I try and download these, the %20 appears in the
>   Netscape file save as box instead of spaces.
> 
>   Does anyone know how or if I can get the browsers to save the
>   files with spaces ?

The only way I've found is simple but tedious:

 1.  Choose "Save As..." or shift-click on a link or whatever
 2.  If the filename doesn't contain %20 then click OK and you're done
 3.  Use your mouse to highlight the first %20 in the filename
 4.  Press the space bar once
 5.  GOTO 2


I suppose you were hoping for a simpler procedure, but this is
the simplest I've found. Possibly IE doesn't have that problem.

 .robin.



Dumb-assed question

2001-01-24 Thread Simon_Wilcox


OK I'm sure I should know this but I don't !

  I have lusers who want to publish M$ Word templates on my site. That's
  fine, once I'd sorted out mime types but these file names have spaces in
  them.

  Dreamweaver (I know, don't ask) nicely escapes the spaces to %20 but when
  I try and download these, the %20 appears in the Netscape file save as box
  instead of spaces.

  Does anyone know how or if I can get the browsers to save the files with
  spaces ?

  Thanks,

  Simon.



__


   This document should only be read by those persons to whom it is addressed
   and is not intended to be relied upon by any person without subsequent
   written confirmation of its contents. Accordingly, our company disclaim all
   responsibility and accept no liability (including in negligence) for the
   consequences for any person acting, or refraining from acting, on such
   information prior to the receipt by those persons of subsequent written
   confirmation.

   If you have received this E-mail message in error, please notify us
   immediately by telephone. Please also destroy and delete the message from
   your computer.

   Any form of reproduction, dissemination, copying, disclosure, modification,
   distribution and/or publication of this E-mail message is strictly
   prohibited.