> Hey everyone,
>
> I have a string of data that I am parsing that looks like this:
>
>         # Replace all of the apostrophed days of week
>         if ($text =~ s/(Sunday's)|(Sunday's Games)/)
>                 {
>                 $day = "Sunday";
>                 $text =~ s/(Sunday's)|(Sunday's Games)//;
>                 }
>         elsif ($text =~ s/(Monday's)|(Monday's Games)/)
>                 {
>                 $day = "Monday";
>                 $text =~ s/(Monday's)|(Monday's Games)//;
>                 }
>         elsif ($text =~ s/(Tuesday's)|(Tuesday's Games)/)
>                 {
>                 $day = "Tuesday";
>                 $text =~ s/(Tuesday's)|(Tuesday's Games)//;
>                 }
>         elsif ($text =~ s/(Wednesday's)|(Wednesday's Games)/)
>                 {
>                 $day = "Wednesday";
>                 $text =~ s/(Wednesday's)|(Wednesday's Games)//;
>                 }
>         elsif ($text =~ s/(Thursday's)|(Thursday's Games)/)
>                 {
>                 $day = "Thursday";
>                 $text =~ s/(Thursday's)|(Thursday's Games)//;
>                 }
>         elsif ($text =~ s/(Friday's)|(Friday's Games)/)
>                 {
>                 $day = "Friday";
>                 $text =~ s/(Friday's)|(Friday's Games)//;
>                 }
>         elsif ($text =~ s/(Saturday's)|(Saturday's Games)/)
>                 {
>                 $day = "Saturday";
>                 $text =~ s/(Saturday's)|(Saturday's Games)//;
>                 }
>
> Surely there is a more efficient and cleaner way to code this.  Any and
all
> assistance is GREATLY appreciated.
>
> Thanks!
>
> -Erich-


Ooops.  BAD BAD BAD.  Please ignore the obvious error of the s/ in the if ..
elsif statements...

-Erich-

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to