need help
with removing myself from this list. I am no longer using Perl and need to reduce my email volume. However, the addresses for removal and for help request don't seem to be working since I am still getting email. Please advise, Thanks Rosemary
Re: Need help with a string parsing problem
On Sat, Jan 17, 2004 at 10:19:24PM -0800, Kim Helliwell wrote: I need to take a string like this: UA-UI1,3,4,6 and expand it into an array of components like this: UA1 UA3 UA4 UA6 UB1 UB3 UB4 UB6 ... UI1 UI3 UI4 UI6 How's this? my $str = UA-UI1,3,4,6; if ( my( $from, $to, $nums ) = ( $str =~ /^(\w+)-(\w+)(\d(?:,\d)*)?$/ ) ) { my @nums = split /,/, $nums; for ( my $chars = $from; $chars le $to; $chars ++ ) { foreach ( @nums ) { print $chars$_\n; } } } else { die Couldn't parse $str!\n; } -- Andy [EMAIL PROTECTED] - http://anime.mikomi.org/ - Community Anime Reviews It's easy to fall into the habit of choosing rigor over vigor. [...] We already have lots of computer languages with rigor, but not so many with vigor. -- Larry Wall in [EMAIL PROTECTED]
Re: Need help with a string parsing problem
At 10:19 pm -0800 17/1/04, Kim Helliwell wrote: I need to take a string like this: UA-UI1,3,4,6 and expand it into an array of components like this: UA1 UA3 UA4 UA6 UB1 UB3 UB4 UB6 ... UI1 UI3 UI4 UI6 How about this: $_ = UA-UI1,3,4,6; m~(..)\-(..)(\d.+)~; for $CC( $1 .. $2 ) { for $n ( split /,/, $3 ) { print $CC$n } } UA1 UA3 UA4 UA6 UB1 UB3 UB4 UB6 UC1 UC3 UC4 UC6 UD1 UD3 UD4 UD6 UE1 UE3 UE4 UE6 UF1 UF3 UF4 UF6 UG1 UG3 UG4 UG6 UH1 UH3 UH4 UH6 UI1 UI3 UI4 UI6
Re: Need help with a string parsing problem
There some sort of regexp strangeness going on here that I can't grok. Your script doesn't work for me unless I print out the values of $1 AND $2. If I just print out one it doesn't work either. turner:~$ cat foo.pl $_ = UA-UI1,3,4,6; m~(..)\-(..)(\d.+)~; for $CC( $1 .. $2 ) { for $n ( split /,/, $3 ) { print $CC$n } } turner:~$ perl foo.pl 01 03 04 06 turner:~$ But oddly, it works if I add a little debuging: turner:~$ cat foo.pl $_ = UA-UI1,3,4,6; m~(..)\-(..)(\d.+)~; print $1, $2\n; for $CC( $1 .. $2 ) { for $n ( split /,/, $3 ) { print $CC$n } } turner:~$ perl foo.pl UA, UI UA1 UA3 UA4 UA6 UB1 UB3 UB4 UB6 UC1 UC3 UC4 UC6 UD1 UD3 UD4 UD6 UE1 UE3 UE4 UE6 UF1 UF3 UF4 UF6 UG1 UG3 UG4 UG6 UH1 UH3 UH4 UH6 UI1 UI3 UI4 UI6 turner:~$ -- Andy [EMAIL PROTECTED] - http://anime.mikomi.org/ - Community Anime Reviews 'Course, that doesn't work when 'a' contains parentheses. -- Larry Wall in [EMAIL PROTECTED]
/tmp v. /tmp/501/TemporaryItems
Can someone please tell me if there's any reason not to write files in /private/tmp rather than in /tmp/501/TemporaryItems ? drwxrwxrwt 29 root wheel 986 18 Jan 21:49 tmp drwxr-xr-x 13 jdwheel 442 18 Jan 21:30 TemporaryItems So far as jd and admin there's never been a problem, but would there be a problem if I were a user with fewer privileges? JD
Re: need help
I did, on five separate occasions, to no avail. A plea for help to the help address resulted in an auto reply and nothing further and no results. Thanks, R On Sun, 18 Jan 2004, Phil Dobbin wrote: On 18/01/2004 14:42, Rosemary Michelle Simpson [EMAIL PROTECTED] wrote: with removing myself from this list. I am no longer using Perl and need to reduce my email volume. However, the addresses for removal and for help request don't seem to be working since I am still getting email. Please advise, Try: mailto:[EMAIL PROTECTED] Regards, Phil.
Re: need help
One possible explanation is that you sent the messages from an address other than the one you're subscribed from. For example, I use a pobox.com address, but pobox.com is just a forwarding service -- I actually read and reply to my mail from a different account, and have to set up my mail software to put [EMAIL PROTECTED] as the reply address. As a result, sometimes unsubscribe requests don't work for me unless I double check what address I'm subscribed with what address I'm using for the unsubscripe request. I'm sure that one of the list admins could help you, but seeing as I don't actually know who administers [EMAIL PROTECTED], we can only wait there. However, if you've really tried five times, maybe someone could provide some constructive suggestions if you forward to the list the error message that the list management software sent you -- chances are, it had an explanation of why the unsubscribe request failed, and looking it over could clarify what you need to do. Alternatively, or additionally, you could examine the message headers from a list message, /or send these headers in a message to the list. If nothing else, that may illustrate where the mail is going to, which as noted above may help explain why unsubscribe requests aren't working. -- Chris Devers
Re: Need help with a string parsing problem
At 3:38 pm -0500 18/1/04, Andy Turner wrote: There some sort of regexp strangeness going on here that I can't grok. Your script doesn't work for me unless I print out the values of $1 AND $2. If I just print out one it doesn't work either. I can't say. I've tried it in BBEdit, in another Perl editor, in Eudora using 'do shell script ...' and in the Terminal and it works fine in all. I ought to say that I'm using Perl 5.8.3, but I certainly was not aware that I was using some great new functionality. Hey, wait a minute -- maybe I was :-) I get your problem if I run it in MacPerl with 5.6.1 and, as you say, it works if I add push @harder, $1$2; before the loop. JD
Re: need help
In fact, I got an auto confirm reply to two of them and no reply to the others, except the auto-reply from help. I'll forward that to you. Thanks for your help! R On Sun, 18 Jan 2004, Chris Devers wrote: One possible explanation is that you sent the messages from an address other than the one you're subscribed from. For example, I use a pobox.com address, but pobox.com is just a forwarding service -- I actually read and reply to my mail from a different account, and have to set up my mail software to put [EMAIL PROTECTED] as the reply address. As a result, sometimes unsubscribe requests don't work for me unless I double check what address I'm subscribed with what address I'm using for the unsubscripe request. I'm sure that one of the list admins could help you, but seeing as I don't actually know who administers [EMAIL PROTECTED], we can only wait there. However, if you've really tried five times, maybe someone could provide some constructive suggestions if you forward to the list the error message that the list management software sent you -- chances are, it had an explanation of why the unsubscribe request failed, and looking it over could clarify what you need to do. Alternatively, or additionally, you could examine the message headers from a list message, /or send these headers in a message to the list. If nothing else, that may illustrate where the mail is going to, which as noted above may help explain why unsubscribe requests aren't working. -- Chris Devers
Re: Need help with a string parsing problem
At 11:03 pm + 18/1/04, John Delacour wrote: Hey, wait a minute -- maybe I was :-) I get your problem if I run it in MacPerl with 5.6.1... It works in 5.6.1 if I quote the matches : $_ = UA-UI1,3,4,6; / (\w\w)-(\w\w)(\d.+) /x; for ($1..$2 ) {for $n ( split /[^\d*]/, $3 ) { print $_$n }}
Re: need help
At 6:11 pm -0500 18/1/04, Rosemary Michelle Simpson wrote: In fact, I got an auto confirm reply to two of them and no reply to the others, except the auto-reply from help. Check at the very top of your mail headers in a list message to see what address you subscribed from, eg: Return-Path: [EMAIL PROTECTED] ( JD=bd8.com [EMAIL PROTECTED] ) Then write from that address.
Re: xterm color support
Hi Gohaku, you wrote... I have a question about the following script: use Term::ANSIColor; print color(red on_white), Danger, Will Robinson!\n; print color(red on_white), Danger, Will Robinson!\n; print color(red on_white), Danger, Will Robinson!\n; print color(reset); Has anybody experienced the same problem or is there a problem with my script? Your script works fine here (10.3.2, using the Term::ANSIColor that came with the standard Perl installation (1.07), and with my TERM set to xterm-color). Of course the standard not very white white background is present, but that's OK: I can see it's *trying* to be white, and just feeling a little bit off-colour... Cheers, Paul
Re: /tmp v. /tmp/501/TemporaryItems
Hi John, you wrote... Can someone please tell me if there's any reason not to write files in /private/tmp rather than in /tmp/501/TemporaryItems ? drwxrwxrwt 29 root wheel 986 18 Jan 21:49 tmp drwxr-xr-x 13 jdwheel 442 18 Jan 21:30 TemporaryItems So far as jd and admin there's never been a problem, but would there be a problem if I were a user with fewer privileges? The big difference between the two locations seems to be that anyone can read the files you drop into /tmp, while the files in /tmp/501 are protected from prying eyes. You can of course change the permissions on files that you make in /tmp so as to shield the contents (or change your umask), but you have the additional problem of not being able to overwrite a temp file owned by someone else. See File::Temp (standard module) for a nice, safe interface to the whole temporary file business. With regards to writing there's no problem: as per the permissions above, anyone can drop a file into the /tmp directory, but only the owner (or an admin using sudo or suchlike) can delete it. Cheers, Paul
Re: ***regular expression***
On Friday, November 14, 2003, at 07:25 AM, xweb wrote: Can someone help me about a regular ? In which way i can substitute a href=$urlstring/a with idlink$val1. I'm not sure I understand exactly what you're asking. Do you mean you want to take the value of $url and place it where $val1 occurs in the substitution string? If that's what you mean, then surround the part of the regex that you want to retain in parentheses and recall it using the $1 ... $9 variables. Like this: $test = a href=\http://www.google.com\;Google/a; $test =~ s/a href=\(http:\/\/www\.google\.com)\Google\/a/idlink\1/; print $test; # test = idlinkhttp://www.google.com; --Rick Anderson The only difference between me and a madman, is that I am not mad. -- Salvador Dali
OT: Virus warning
Off-topic, I know, and I apologize for that in advance. Today I received two emails, both with forged headers. One appeared to come from Pudge (Chris Nandor), and the other from Mattias Neeracher. Both included virus attachments. Someone is apparently targeting a virus towards MacPerl developers, and their approach is both clever and stupid at the same time. Obviously, the message is more likely to appeal to its target audience than any of the many Important Windows Update! messages I receive daily. On the other hand, the attachment is a .exe file... ;-) sherm--
Re: OT: Virus warning
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Sherm Pendley) wrote: Off-topic, I know, and I apologize for that in advance. Today I received two emails, both with forged headers. One appeared to come from Pudge (Chris Nandor), and the other from Mattias Neeracher. Both included virus attachments. Someone is apparently targeting a virus towards MacPerl developers, and their approach is both clever and stupid at the same time. Obviously, the message is more likely to appeal to its target audience than any of the many Important Windows Update! messages I receive daily. On the other hand, the attachment is a .exe file... ;-) I don't know who is being targetted, but I got a ton from Matthias and Jarkko (about 50 between the two addresses). -- Chris Nandor [EMAIL PROTECTED]http://pudge.net/ Open Source Development Network[EMAIL PROTECTED] http://osdn.com/
Re: /tmp v. /tmp/501/TemporaryItems
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (John Delacour) wrote: Can someone please tell me if there's any reason not to write files in /private/tmp rather than in /tmp/501/TemporaryItems ? drwxrwxrwt 29 root wheel 986 18 Jan 21:49 tmp drwxr-xr-x 13 jdwheel 442 18 Jan 21:30 TemporaryItems So far as jd and admin there's never been a problem, but would there be a problem if I were a user with fewer privileges? /tmp/501/TemporaryItems/ is your personal temporary items folder. Witness: $ perl -MMac::Files -le ' print FindFolder(kOnSystemDisk, kTemporaryFolderType)' /private/tmp/502/TemporaryItems $ sudo -u maintenance perl -MMac::Files -le ' print FindFolder(kOnSystemDisk, kTemporaryFolderType, kCreateFolder)' /private/tmp/501/TemporaryItems $ sudo -u guestuser perl -MMac::Files -le ' print FindFolder(kOnSystemDisk, kTemporaryFolderType, kCreateFolder)' /private/tmp/503/TemporaryItems So when Mac apps use the standard Mac OS API to create temp files, that's the path they get, and if you want to restrict temp files to a particular user, then feel free to do the same. Of course, you don't necessarily need to use Mac::Files and FindFolder, you can probably create the path yourself, though I wouldn't recommend that personally. See man Mac::Files for details, or point your browser to: file:///Developer/Documentation/Carbon/Reference/Folder_Manager/index.html See especially FindFolder under Functions, and Folder Type Constants and Disk and Domain Constants under Constants. -- Chris Nandor [EMAIL PROTECTED]http://pudge.net/ Open Source Development Network[EMAIL PROTECTED] http://osdn.com/
Re: reading resource fork of Freehand (8) files
In article [EMAIL PROTECTED], [EMAIL PROTECTED] (Joergen W. Lang) wrote: my $text = GetResource( 'TEXT', '256'); print Dumper $text; This gives me: $VAR1 = \bless( do{\(my $o = 65688)}, 'Handle' ); so I obviously have a handle to the resource. But how to get the actual data (should be something like 'here is the description')? You have a Handle object, which is described in Mac::Memory. You may need to use Mac::Memory in your script to gain access (as Mac::Resources doesn't load it for you). The basic syntax is: print $text-get; Other options on a Handle object include set(), append(), size(). e.g., $ perl -MMac::Memory -le ' $a = new Handle foo; print $a-size; print $a-get; $a-append(bar); print $a-size; print $a-get; ' 3 foo 6 foobar Cheers, -- Chris Nandor [EMAIL PROTECTED]http://pudge.net/ Open Source Development Network[EMAIL PROTECTED] http://osdn.com/
Re: OT: Virus warning
On Sunday, January 18, 2004, at 09:58 PM, Chris Nandor wrote: I don't know who is being targetted, but I got a ton from Matthias and Jarkko (about 50 between the two addresses). My boss got a copy which had a forged from of [EMAIL PROTECTED]. They look like junk faxers, which is neither here nor there. Since we (My employer and I) are in the business of tracking down 'net abusers, we've both taken the liberty of dumping the .exe into a hex editor, and comparing notes. Thanks to Sherm Pendley for forwarding his copy, as I tend not to get these things directly. It's a two-stage worm. The initial .exe is quite small, contains an SMTP engine for sending itself, and pulls addresses from the victim's address book for both new victims and forged From:. Clearly some infected person has Chris, Matthias and Jarkko in their address book, and likely others. Stage two is a file beagle.exe which stage one grabs from a list of cracked servers running a PHP script 1.php. I've not examined this .exe yet, but I have a fair idea what it does. The rest of this is phenomenally boring, unless you do it for pay, so at this point I return you to your regularly scheduled Mac OS X Perl discussion. --B
Re: OT: Virus warning
On Sunday, January 18, 2004, at 10:34 PM, Brian McNett wrote: The rest of this is phenomenally boring, unless you do it for pay, so at this point I return you to your regularly scheduled Mac OS X Perl discussion. Oh... Symantec is calling it [EMAIL PROTECTED]. Just discovered today. http://www.symantec.com/avcenter/vinfodb.html --B