[29283] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 527 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sun Jun 17 11:10:08 2007

Date: Sun, 17 Jun 2007 08:09:08 -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           Sun, 17 Jun 2007     Volume: 11 Number: 527

Today's topics:
    Re: 12 hour clock and offset problem <dbroda@gmail.com>
    Re: 12 hour clock and offset problem <dbroda@gmail.com>
    Re: 12 hour clock and offset problem <purlgurl@purlgurl.net>
    Re: 12 hour clock and offset problem <purlgurl@purlgurl.net>
    Re: 12 hour clock and offset problem <dbroda@gmail.com>
    Re: could XML::Simple handling chinese character? <adrian@blinkenlights.ch>
        For Loop <mdmoura@gmail.com>
    Re: For Loop <mritty@gmail.com>
    Re: For Loop <tadmc@seesig.invalid>
        Generic Syntax highlighting module <stephen.odonnell@gmail.com>
    Re: Get the piece of code in perl <tadmc@seesig.invalid>
    Re: Need help reading two-dimentional array from a file <tadmc@seesig.invalid>
    Re: perl and  php <eflorac@imaginet.fr>
    Re: Perl script to identify corrupt mbox messages? <tuxedo@mailinator.net>
    Re: replacing a special character <hjp-usenet2@hjp.at>
    Re: Which Perl 5 OO extension can be seen as "standard" <eflorac@imaginet.fr>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Sun, 17 Jun 2007 11:05:16 -0000
From:  Kenetic <dbroda@gmail.com>
Subject: Re: 12 hour clock and offset problem
Message-Id: <1182078316.947853.88690@z28g2000prd.googlegroups.com>

On Jun 16, 9:19 am, Brian McCauley <nobul...@gmail.com> wrote:
> On Jun 16, 4:40 pm, Kenetic <dbr...@gmail.com> wrote:
>
> > I'm trying to convert an input time to the offset time in a 12 hour
> > clock system. It's giving me a headache. The am and pm must be the
> > right ones when the offset is added to the input time ($temptime). I
> > understand it's better to use a 24 hour clock, but unfortunately I
> > can't in this situation. Everything needs to be done in 12-hour
> > format.
>
> What makes you think that _everything_ needs to be done in 12-hour
> format?
>
> Maybe input and output needs to be in 12-hour format but I can see no
> reason why intermediate values should not be in, say, seconds or
> minutes since midnight.
>
> > In short, 10:00 am with an offset of -3 should result in 1:00 pm;
> > 10:00 pm with an offset of -3 should result in 1:00 am.
> > I've been at this for awhile, sadly, and cannot wrap my head around
> > it. Any help to point me in the right direction would be fantastic.
>
> > This is my latest version, which works to a certain extent--the
> > difficulty is the AM/PM to switch.
>
> > my $offset = -3;
> > my $tempTime = "10:00 pm";
> > sub myMod {
> >         my ( $a, $b ) = @_;
> >         my $div = $a / $b;
> >         return $a - int( $div ) * $b;
> >         }
>
> Perl has a mod operator.
>
> > sub getutc {
> >         my $time = shift;
> >         my $GMTOffset = shift;
> >         $time =~ /(\d{1,2}):(\d\d)\s(.+)*/;
>
> You should always check the match succeeds before you use the result.
> At least say "or die".
>
> >         # Is UTC a .5 remainder? if so, chop it off--we use
> >         # it later regardless
>
> I don't get all that, I'll ignore it.
>
> >         my $hours = $1;
>
> It's usually preferable you use the return value of the m// operator
> rather than $1 etc.
>
>
>
> >         if (myMod($hours,int($hours)) == -0.5) {
> >                 $hours - 0.5;
> >                 }
> >         my $minutes = $2;
> >         my $ampm = $3;
> >         #Take hours and subtract whole number in Offset Time
> >         $hours = $hours - int($GMTOffset);
> >         if ($hours >= 12) {
> >                 $ampm = "pm";
> >                 $hours = $hours - 12
> >         }
> >         # If 0.5 on the Offset, then add 30 minutes and wrap
> >         if (myMod($GMTOffset, int($GMTOffset)) == -0.5) {
> >                 $minutes = $minutes + 30;
> >                 if ($minutes >= 60) {
> >                         $minutes = $minutes % 60;
> >                         $hours = $hours + 1;
> >                 }
> >         }
> >         $minutes = sprintf("%02d", $minutes);
> >         $hours = sprintf("%2d", $hours);
>
> sprintf can format several arguments at once.
>
> >         if ($hours == 0) { $hours = "12";}
> >         return $hours.":".$minutes." ".$ampm;
>
> > }
>
> > my $theTime = getutc($tempTime, $offset);
> > print "\nCurrent time: $tempTime\n";
> > print "Adjust ".$offset." hours\n";
> > print "Adjusted to: $theTime\n";
>
> #!perl
> use strict;
> use warnings;
>
> my $offset = -3;
> my $tempTime = "10:00 pm";
>
> sub getutc {
>         my $time = shift;
>         my $GMTOffset = shift;
>         my ($hours,$minutes,$ampm) =
>             $time =~ /(\d{1,2}):(\d\d)\s*([ap]m)/ or die;
>         $hours += 12 if $ampm eq 'pm';
>         my $m = (($hours - $GMTOffset) * 60 + $minutes ) % ( 24 * 60 );
>         return sprintf("%2d:%02d %s",
>                        int($m / 60 + 11 ) % 12 + 1,
>                        $m % 60,
>                        $m < 12 * 60 ? 'am' : 'pm');
>
> }
>
> my $theTime = getutc($tempTime, $offset);
> print "\nCurrent time: $tempTime\n";
> print "Adjust $offset hours\n";
> print "Adjusted to: $theTime\n";
> __END__

Brian, the reason why I need to use a sub for mod  is that perl's mod
doesn't work very well with fractions. I picked this snippet up from
perlmonks, if you compare '3.5 % 3' and myMod(3.5, 3), the former will
result in 0, the latter is 0.5. Thank you for your tips about the
matching and strftime, those are quite valuable during this journey
through perl. It's also true that the format can take on whatever form
in the intermediary, however raw input and eventual output are in 12-
hour format. I've built a similar time conversion in excel using
minutes so I understand what your saying.

Other then that, I think your scripts works to the extent that 12 pm
and 12 am don't work properly.

Cheers,



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

Date: Sun, 17 Jun 2007 14:07:20 -0000
From:  Kenetic <dbroda@gmail.com>
Subject: Re: 12 hour clock and offset problem
Message-Id: <1182089240.297700.14290@z28g2000prd.googlegroups.com>

On Jun 17, 1:47 am, "Mumia W." <paduille.4061.mumia.w
+nos...@earthlink.net> wrote:

>
> As the others have said, use already-made modules for this sort of
> thing. The module writers have already worked out most of the complexities.
>

I'll most likely be unable to use any external modules. One of the
constraints I have unfortunately.

I've almost got the minutes to work, but I'm missing am or pm, so I
can't test it that well. Just getting the hang of substr and index, I
suppose. Looks promising though.

Cheers,



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

Date: Sun, 17 Jun 2007 07:23:39 -0700
From: Purl Gurl <purlgurl@purlgurl.net>
Subject: Re: 12 hour clock and offset problem
Message-Id: <bpKdnZHlH5Ft3ujbnZ2dnUVZ_ternZ2d@giganews.com>

Kenetic wrote:

> Purl Gurl wrote:

(prior code example snipped)

>> Let me know if you find any glitches.

> It looks like it works particularly with 12 am and 12 pm, and since
> you have a handle on the script (there are some things in here I
> haven't used extensively--just a novice at perl), I wonder if you can
> modify it to include, .5 of an hour. The offset can be -3 or -3.5 for
> 3 hours and 30 minutes. Also to be considered is how :30 past the hour
> would then wrap around to the next hour, which is easy enough
> (although when wrapping past 12 am or pm might pose a challenge)

Rather than complete code for your task, I have opted for discussion.

You are, again, running into convention problems. Convention is to
adjust time by hours, only, to determine a local time. This is clearly
based on longitude location. Adding a problem is daylight savings time
which is used in some regions, not used in other regions.

Adjusting local time by minutes violates all conventions but does
not violate precision in time based on precise longitude location.
Use of minutes for time adjustment is truly stating degrees of
longitude in hours and minutes, which becomes rather complex, and
even more complex if adjustment is made including seconds.

My suggestion is you look at longitude and latitude scripts with
giving direct attention to longitude formulas. This is a serious
suggestion which you should follow; you will find lots of coding
which addresses your task of incorporating minutes and will include
methods to incorporate seconds.

Right off, if your minutes will always be " x.5 " notation, this
is, always 30 minutes, I would simply add 30 minutes to your original
minutes, then adjust if this new minutes amount exceeds 60 minutes.

if (index ($add_hours, ".5") > -1)
  { add 30 minutes and perform calculations here }

Following is example code for dealing with fractions. This example
does display working with a fractional hour and displays how precision
is lessened by use of the int() function within perl core. Use of int()
discards any fractional part and leaves only a whole number. Clearly
this reduces accuracy precision of results,

 .5 equals 30 minutes
 .33 equals 19.8 minutes (int return is 19)

However, if you are dealing with only tenths,

 .1 .2 .3 .4 .5 .6 .7 .8 .9

there is no need for the int() function; returns are always whole numbers
without the int() function.

Although there is no need for int() in my example code, I have included
this function to demonstrate to readers how precision is reduced and to
demonstrate how code like this, how dealing with time, can become very
complex and very frustrating. You and other readers can use adjustment
times beyond tenths, 3.53 hours or 3.67 hours and such, to compare code
results with hand calculated results; a fractional minute will be created
without int() functions included.

Find in my example,

$add_hours = int ($adjust);

This is simply a quick and dirty method to extract "3"
from the 3.5 adjustment time for my $add_hours variable.

Find in my example,

$add_minutes = int ($hour_fraction * 60);

This is where precision is reduced for more complex
calculations. The int() function is NOT needed when
you deal only with tenths, 3.2 3.5 3.7 and such. This
int() can be removed,

$add_minutes = $hour_fraction * 60;

However, if you introduce the hundredth decimal place,
you either must use int() and reduce precision or add
more code to maintain higher precision.

Again, look at longitude code examples to learn how to
create very high precision in time adjustment. You are
truly dealing with longitude calculations expressed as
time; hours, minutes and seconds. Give good attention
to the International Date Line to note how time can
be radically altered when you meet or exceed 180 degrees
longitude or, in time, plus 24 hours exactly or more.

I am not serving you up code on a silver platter. This
example code provides you the basic concept of how to
deal with time adjustments which include a fractional
hour. You will learn more through figuring out how to
incorporate this example into whatever final code you
elect to use; learning is the point, not easy answers.

No "walk through" this time. No full and complete code.
You have been provided enough help by participants here,
have been given enough code examples. You will learn a lot
more by writing your own code. Do so.

If you encounter problems after writing your own code,
then return and ask for help.


#!perl

$time = "11:30 pm";

$adjust = 3.5;

$old_hour = substr ($time, 0, index ($time, ":"));
$old_minutes = substr ($time, -5, 2);

$add_hours = int ($adjust);

$hour_fraction = $adjust - substr ($adjust, 0, index ($adjust, "."));

$add_minutes = int ($hour_fraction * 60);

$new_minutes = $old_minutes + $add_minutes;

if ($new_minutes >= 60)
  {
   $new_minutes = $new_minutes - 60;
   $add_hours++;
  }

$new_hour = $old_hour + $add_hours;

print "New Hour is $new_hour";
print "\n\n";
print "New Minutes are $new_minutes";


PRINTED RESULTS:

New Hour is 15

New Minutes are 0



---

> Thanks for all the help so far, it's been overwhelming.

I must introduce something off-topic, must masturbate my
ego through rant. Research will disclose almost all within
this discussion group, almost all within our Perl Community,
for years, claim me to be an blithering idiot of a troll,
and do so, almost on a daily basis.

This amuses me, greatly.


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


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

Date: Sun, 17 Jun 2007 07:52:20 -0700
From: Purl Gurl <purlgurl@purlgurl.net>
Subject: Re: 12 hour clock and offset problem
Message-Id: <TpudnWJVMPc21-jbnZ2dnUVZ_oqmnZ2d@giganews.com>

Kenetic wrote:

> Mumia W. wrote:

>> As the others have said, use already-made modules for this sort of
>> thing. The module writers have already worked out most of the complexities.

> I'll most likely be unable to use any external modules. One of the
> constraints I have unfortunately.

> I've almost got the minutes to work, but I'm missing am or pm, so I
> can't test it that well. Just getting the hang of substr and index, I
> suppose. Looks promising though.

If you are to master Perl programming, do not use modules.

Larry Wall, Randal Schwartz, Joseph Hall, Brigitte Jellinek and others
like them, did not become masters of Perl through using modules. Those
people and others became great Perl programmers by teaching themselves
how to write code, by hand. All of those people and others, like me,
were around long before modules came about.

Are we to label those people "stupid" because there was a time
they _never_ used modules?

A handful of modules are excellent. Socket, LWP and Astro::MoonPhase
are all excellent modules. A majority of modules are mediocre and
better replaced with hand coding. Many modules are simply junk.

Stein's CGI.pm is an absolute nightmare and is amongst the absolute
worst of choices for use by a Perl programmer. Nonetheless, Stein's
module is bundled with Perl and the most popular module.

Some hand coding is so very complex, so very difficult, use of a module
is justified, such as Socket and LWP. However, use of a module does not
dismiss you from learning how a module is coded and operates. Almost
always, ninety-nine percent of case examples, a module is not needed
and often is a mistake through reduction of efficiency and through
introducing bugs.

There is a nickname for adamant module users, "Copy And Paste Babies."

Do you want to be known as a Perl Programmer or a Copy And Paste Baby?

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


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

Date: Sun, 17 Jun 2007 15:00:54 -0000
From:  Kenetic <dbroda@gmail.com>
Subject: Re: 12 hour clock and offset problem
Message-Id: <1182092454.733393.11930@g37g2000prf.googlegroups.com>

Sounds good. I am definitely learning more then I bargained for as I
didn't expect such a in-depth response. Of course, time is a rather
complex thing. I'm certainly interested in learning this rather then
just copy and paste and have it work--my first perl script was a lot
of fun to put together and it didn't dawn on me to seek out a group
like this one. In fact, I enjoy doing the research and teaching
myself. The reason I was wondering if you could handle minutes was
under the assumption others knew it was part of the original problem.
I didn't make that clear enough in my comments.

Anyway, I think I should have more then enough information, as you
mentioned, to complete this even if it takes a little while longer.
Would love to have the satisfaction of finally seeing the results I
want.

Thanks again,



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

Date: Sun, 17 Jun 2007 13:32:11 +0200
From: Adrian Ulrich <adrian@blinkenlights.ch>
Subject: Re: could XML::Simple handling chinese character?
Message-Id: <20070617133211.bf868f25.adrian@blinkenlights.ch>


You told XML::Something that this XML-File will be utf8 encoded
> <?xml version="1.0" encoding="utf-8"?>
>   <user>和平</user>

 ..so is '和平' UTF-8 encoded? I'd recommend a real unicode editor like
yudit (http://www.yudit.org) to edit/create utf8 files.

> when i changed chinese character with english word, it works fine.

UTF-8 is a superset of ASCII. A normal ASCII string will always be valid UTF-8.

Regards,
 Adrian



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

Date: Sun, 17 Jun 2007 05:51:59 -0700
From:  shapper <mdmoura@gmail.com>
Subject: For Loop
Message-Id: <1182084719.688393.80790@q75g2000hsh.googlegroups.com>

Hello,

I don't know PERL and I need to convert a simple code to C# or VB.NET.

Could someone, please, help me with the conversion?
A description of how the loop works would be enough.

for $row (1..$h)
{   for ($s=0,$i=$row; $s<$c; $i+=($h+($s<$rm)), ++$s)
    {   printf "%7u", $i   }
    print "\n";

}

++$h;
for ($s=0,$i=$h; $s < $rm; $i+=$h, ++$s)
{   printf "%7u", $i   }

Thanks,
Miguel



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

Date: Sun, 17 Jun 2007 14:33:45 -0000
From:  Paul Lalli <mritty@gmail.com>
Subject: Re: For Loop
Message-Id: <1182090825.429645.254170@q75g2000hsh.googlegroups.com>

On Jun 17, 8:51 am, shapper <mdmo...@gmail.com> wrote:
> I don't know PERL

Perl.  Not PERL.

> and I need to convert a simple code to C# or VB.NET.
>
> Could someone, please, help me with the conversion?
> A description of how the loop works would be enough.
>
> for $row (1..$h)

This will loop through the numbers 1 through $h, incrementing by 1
each time, and each iteration setting $row to be the current value.
So if, for example, $h was 5, this would loop five times, setting $row
to 1, 2, 3, 4, and 5, in turn.


> {   for ($s=0,$i=$row; $s<$c; $i+=($h+($s<$rm)), ++$s)

This starts $s at 0 and $i at whatever $row is in this iteration.  It
continues to loop so long as $s is less than $c.  At the end of each
iteration, it increments $s by 1, and adds $h to $i.  If $s is less
than $rm, it will add an aditional 1 to $i.

>     {   printf "%7u", $i   }

This prints the current value of $i, padded to 7 spaces.

>     print "\n";

This prints a newline.
>
> }
>
> ++$h;

Increment $h by one.

> for ($s=0,$i=$h; $s < $rm; $i+=$h, ++$s)

Starts $s at 0, $i at $h.  Loops while $s is less than $rm.  At the
end of each iteration, adds $h to $i, and increments $s by 1.

> {   printf "%7u", $i   }

Prints the current value of $i, again padded 7 spaces.

> Thanks,

You're welcome.

Paul Lalli



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

Date: Sun, 17 Jun 2007 15:03:15 GMT
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: For Loop
Message-Id: <slrnf7afuo.i3f.tadmc@tadmc30.sbcglobal.net>

shapper <mdmoura@gmail.com> wrote:


> I don't know PERL 


We can tell, because you did not spell "Perl" correctly.  :-)


> and I need to convert a simple code to C# or VB.NET.
>
> Could someone, please, help me with the conversion?
> A description of how the loop works would be enough.


Descriptions of Perl syntax are in the perlsyn.pod documentation:

    perldoc perlsyn


> for $row (1..$h)


That one is covered in the "Foreach Loops" section.


> {   for ($s=0,$i=$row; $s<$c; $i+=($h+($s<$rm)), ++$s)


That one is covered in the "For Loops" section.


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


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

Date: Sun, 17 Jun 2007 13:33:03 -0000
From:  Stephen O'D <stephen.odonnell@gmail.com>
Subject: Generic Syntax highlighting module
Message-Id: <1182087183.374807.65020@m36g2000hse.googlegroups.com>

Guys,

I am looking for a module that can syntax highlight lots of different
types of source code so I can display it in a browser.

I have tried installing Syntax::Highlight::Universal, which is based
on the Colorer library, but it fails to compile for me and the module
doesn't seem to be maintained any more.

Any suggestions of a good module to use that supports many different
languages?

thanks,

Stephen.



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

Date: Sun, 17 Jun 2007 15:03:16 GMT
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: Get the piece of code in perl
Message-Id: <slrnf7ah9d.i3f.tadmc@tadmc30.sbcglobal.net>

asimsuter@hotmail.com <asimsuter@hotmail.com> wrote:
> On Jun 14, 5:37 am, Paul Lalli <mritty@gmail.com> wrote:

>> my $file = do { local $/; <DATA> };
>> my @codes = ($file =~ /AAA(.*?)BBB/sg);
>> foreach $code (@codes) {
>>   print "$code\n\n";
>>
>> }


> Note m modifier for multiline search which is a key element.
                                             ^^^^^^^^^^^^^^^^

No it isn't.

The m modifier changes the meaning of the ^ and $ anchors.

The m modifier is a key element only if your pattern contains
the ^ or $ anchors.


> Regards.
> Asim Suter
> asimsuter@hotmail.com


Signatures are customarily included at the _end_ of a posting
rather than in the middle.


>             print "$TO_ADD" ;


    perldoc -q vars

       What’s wrong with always quoting "$vars"?

so that should be:

    print $TO_ADD ;


>             my $NEW_FILE_CONTENT = substr ( $whole_file , 0 , $p ) .
>                                    "\n\n" .
>                                    $TO_ADD .
>                                    substr ( $whole_file , $p ) ;
>
>
>             seek( FH , 0, 0 )               or die "Can't seek to
> start of \"$fileName\": $!" ;
>             print FH $NEW_FILE_CONTENT      or die "Can't print to
> \"$fileName\": $!" ;
>             truncate ( FH , tell(FH) )      or die "Can't truncate
> \"$fileName\": $!" ;


If you think that the truncate() call is necessary there, then
you are mistaken on that point as well.


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


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

Date: Sun, 17 Jun 2007 15:03:15 GMT
From: Tad McClellan <tadmc@seesig.invalid>
Subject: Re: Need help reading two-dimentional array from a file
Message-Id: <slrnf7aj46.i3f.tadmc@tadmc30.sbcglobal.net>


[ Please do not top-post.
  Please do not full-quote.
  Text rearranged into a sensible order (chronological).
]


asimsuter@hotmail.com <asimsuter@hotmail.com> wrote:
> On Jun 14, 12:00 pm, Paul Lalli <mri...@gmail.com> wrote:

>> my @foo = eval do { local $/; <DATA>} ;

> my @foo = eval do { local $/; <DATA>} ;


It is customary to quote text that you are going to comment on
rather than repeat the text as if it was original to you.


> I hear in Perl6 they are coming up with a new inbuilt for above called
                                                        ^^^^^^^^^
> 'slurp'


You heard incorrectly then.

slurp reads a file, it does not evaluate the file as Perl code
like the above does.


> Regards.
> Asim Suter
> asimsuter@hotmail.com


It is customary to put your .signature an the _end_ of your article,
preceded by a proper sig-dash ("-- \n").


-- 
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"


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

Date: Sun, 17 Jun 2007 16:28:35 +0200
From: Emmanuel Florac <eflorac@imaginet.fr>
Subject: Re: perl and  php
Message-Id: <pan.2007.06.17.14.28.33.123799@imaginet.fr>

Le Tue, 12 Jun 2007 11:19:32 +0000, peter a écrit :

> 
> 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.

php is a specialized tool. It's very good for the quick and dirty job, and
good for the kind of stuff you'll often find on thedailywtf.com or
codinghorror.com .
It has a lot of very nasty defaults that are mostly unvisible to the
beginner and the people without a "real" programming background, that will
bite you sooner or later :

- no real namespaces
- cluttered main function namespace
- lots of redundant functions with slightly different syntax and behaviour
- helps "bad programming" by mixing up html markup and php logic
- many security caveats; nothing similar to the "-T" flag in perl, or "use
strict", or "use warnings"
- syntax and defaults vary quite alot from version to version ; I had to
rewrite big parts of my php code to go from php 3 to 4, then 4.0 to 4.2,
then 4.2 to 5.0... Perl4 code written in 1992 works out of the box 99% of
the time with the current perl binary 
- stupid typing : making things simpler for beginners make them unsortable
for everyone, see the ridiculous "==" and "===" comparison operators
- two entirely different object models in the current implementations,
php 4 and 5.

php pros :
- it's very easy to install and setup (it's made for windows users and
programming teenagers, not system administrators and real programmers)
- the php 5 object system is at last pretty good (but for perl, Moose
beats anything else on earth, and the default object system is the most
flexible for the knowledgeable)
- if you use php, you may have endless discussion on usenet/forums/IRC/AIM
with gazillions of beginners and bad programmers, about the bad ways to
get your bad code mostly working :)


-- 
Le commissaire : Comment vous appelez-vous?  
Garance : Moi je ne m'appelle jamais, je suis toujours là. J'ai pas
besoin de m'appeler. Mais les autres m'appellent Garance, si ça peut
vous intéresser.
Prévert,"les enfants du Paradis".



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

Date: Sun, 17 Jun 2007 15:25:41 +0200
From: Tuxedo <tuxedo@mailinator.net>
Subject: Re: Perl script to identify corrupt mbox messages?
Message-Id: <f53col$kkv$02$1@news.t-online.com>

Petr Vileta wrote:

> Tuxedo wrote:
> Waht my Tbird2OE? Helped you? I want to know the result ;-)
> 

Sorry, but unfortunately I did not get a chance to test your program, 
mainly due to time constraints. Also, I have a feeling that converting to 
mdir or eml and then back to mbox again will not work in that the cause 
will simply remain throughout the process and the problem will appear again 
in Mozilla. Instead, my solution has been to move the mbox to a unix system 
where the user can access it via a webmail interface. The mbox is 
completely readably on any mbox reader except Mozilla. Nevertheless, thanks 
for your kind advise! I have bookmarked your program and for another time.




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

Date: Sun, 17 Jun 2007 14:23:35 +0200
From: "Peter J. Holzer" <hjp-usenet2@hjp.at>
Subject: Re: replacing a special character
Message-Id: <slrnf7a9u7.lnb.hjp-usenet2@zeno.hjp.at>

On 2007-06-14 20:00, Paul Lalli <mritty@gmail.com> wrote:
> On Jun 14, 3:35 pm, "laredotorn...@zipmail.com"
><laredotorn...@zipmail.com> wrote:
>> I'm running Fedora Linux Core 5.  I have some weird characters in my
>> files that are causing HTML validation to fail.  In vim, they appear
>> like
>>
>> Anderson<92>s
>>
>> where "<92>" is this odd character.  It should really be an
>> apostraphe.  My question to the group is how do I run a perl search
>> and replace command along the lines of
>>
>> perl -pi -e 's/old_expr/new_expr/g' myfile.html
>>
>> to swap out the bizarre "<92>" character with an apostraphe?
>
> Sounds like you have a "smart quote" in there.  Hex 92 is Decimal 146,
> which is the ' character in whatever character set I'm using....
>
> I would try:
> perl -pi -e"s/\x22/'/g" myfile.html

ITYM:

  perl -pi -e"s/\x92/'/g" myfile.html

	hp


-- 
   _  | Peter J. Holzer    | I know I'd be respectful of a pirate 
|_|_) | Sysadmin WSR       | with an emu on his shoulder.
| |   | hjp@hjp.at         |
__/   | http://www.hjp.at/ |	-- Sam in "Freefall"


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

Date: Sun, 17 Jun 2007 16:54:37 +0200
From: Emmanuel Florac <eflorac@imaginet.fr>
Subject: Re: Which Perl 5 OO extension can be seen as "standard" (defacto, quasi)?
Message-Id: <pan.2007.06.17.14.54.37.900117@imaginet.fr>

Le Sat, 16 Jun 2007 22:30:09 +0000, Ilias Lazaridis a écrit :

> 
> Is there possibly an community agreement on a standard accessor- extension
> (e.g. "
> if you have to use automated accessor generation, use CPAN::???)

I don't know for the accessors specifically, but Moose really blows
everything else away IMHO.

-- 
"Dope will get you through times of no money better
than money will get you through times of no dope." 
Freewheelin' Franklin.



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

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


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