|
12/25 |
2001/7/12 [Computer/SW/Languages/Perl, Computer/SW/Languages/Web] UID:21779 Activity:nil |
7/11 who offers classes on PHP in the east bay area? work is paying. \_ take the money and go get some cheap whores... why would you want to take a PHP class? \_ d00d! "cheap"?! do you realize how much a "PHP class" is likely to cost? this'd cover an all-night orgy with half a dozen top-notch professionals... \_ Don't bother. If you know perl, you can learn PHP. It's simpler, albeit with uglier syntax, and, IMHO, inferior. If you don't know perl, learn it. If you can't learn perl, you obviously have issues with functional programming languages, and won't be able to learn PHP. \_ Dude. If Perl is a functional programming language then the Moon is made of green cheese. Lambdas do not a functional language make. Perl is about as procedural as they come. It's proud of it in fact. Perl is evil. Look at Ocaml if you want to know what Perl could have been if it was a good little language. \_ Hah! Shows what *you* know! You can do ANYTHING with perl! even get yourself fired!!1! err....hold on a second.... that came out wrong.... |
2001/7/3 [Computer/SW/Languages/Perl] UID:21702 Activity:high |
7/2 How do I change the path perl checks when I do a "require"? \_ Ocaml >> perl. \_ use lib "/my/module/directory"; See "perldoc perlfaq8" for details. \_ This probably still works: BEGIN { push (@INC,"/my/dir/with/modules") ; } \_ It does; see "perldoc lib" for the differences. \_ lib is a perl module (.pm) right? I generally avoid those since they are not compatible with perl4 (yes people still use this). \_ If it's a script, I find it easier to just change the #! line to: #!/path/to/perl -I/my/module/directory |
2001/6/23 [Computer/SW/Languages/Perl] UID:21608 Activity:high |
6/22 Is there a utility that helps you decode a hex dump? I want a tool that lets you enter each field and the size of each field. Then it takes in an ASCII hex dump and then decodes it according to the field information. I'm getting a headache reading all these hex dumps. Thanks. \_ perl is your friend. \_ Perl is the jism of satan. \_ is that a bad thing? \_ I didn't know Saddam Hussein had a csua account. \_ Get off my dick. \_ I'm the hot gay dragon. \_ What kind of a Marine are you??? \_ indeed. try "perldoc -f pack" \_ scanf("%x", ...)? \_ listen guys, I do not want to write any code to do this. I'm looking for an application already written. Free or shareware would be nice. thanks. \_ An application to do this would require you to specify the format of your particular dump in some kind of detailed manner. Jeez, just write the 5 or 10 lines of code it will take. \- possibly emacs hexl-mode --psb \_ what platform? if Windows, frhed will let you do something like this, although it's a bit limited (byte/short/int/long/float/double fields only; can't specify bit-fields, can't specify arrays, etc.) \_ exactly. you could specify a text file with type/size information with each field, etc. ok, making a custom program to do it wouldn't be hard, but an already-existing, general program would be still be easier. |
2001/5/29 [Computer/SW/Languages/Perl] UID:21378 Activity:high |
5/30 tom, why are you adding "anonymous coward" and attributing every new post this morning to me? You're even adding "anon coward" to things I signed. And you're also attributing things to me posted by others. You're one weird dude and you also need to get your facts straight. As far as censoring goes, that's a funny accusation coming from you, someone who obliterates without comment numerous things you don't agree with. Just so you know, I've got to get on with my day now, so you're free to libel and misquote me for the next few hours. Have a pleasnt morning. -reiffin \_ I would also like to take this oppuortunity to tell you to go to hell, Tom, for the posts of mine you've cowardly deleted past. -lafe \_ that's just tom's way. Him and his "RIDE BIKE TO THE THIRD REICH" - he's like Hitler on cheap weed. (perl and a cronjob, tom.) \_ go, reiffin! --anonymous coward \_ go, reiffin! --anonymous coward (!reiffin and !anonymous cowards below) \_ go tom! - not tom \_ I'm a part-time student and full-time staff member at U.C. Berkeley. I'm studying Computer Science, and working doing computer support for Letters and Sciences Computer Resources. I am active in the Computer Science Undergraduate Association and am on CSUA machine staff on a volunteer basis. --anonymous coward \_ I am an anonymous coward. -- anonymous coward (!reiffin, in this case) \_ Just believe everything reiffin says and you will be okay. -!!psb \_ !!!!!!! |
2001/5/12 [Computer/SW/Compilers, Computer/SW/Languages/Perl, Computer/SW/Editors/Vi] UID:21252 Activity:nil |
5/11 http://www.grrl.com/hackerboy.html |
2001/4/26-27 [Computer/SW/Database, Computer/SW/Languages/Perl] UID:21112 Activity:nil |
4/26 I'm looking for software that can do the following. Anybody know of such a package for a small business? 1. Track customers' data and their order history. Plus I need to enter customized data fields that can be searched. E.g, "list all customers who ordered XYZ". 2. A way to combine information from a arbitrary number of customers. E.g., "list all order from all customers from such date to such date". 3. Some minimum accounting functionality. Accounts payable, accounts receivable. Simple stuff. I'm doing all this stuff in Excel. And it's getting hard to manage. I need like a small database with a customizable front-end. But with a lot of small-business functions preconfigured. Thanks. \_ /usr/bin/perl or /usr/local/bin/perl on some systems. \_ Used to do this in Access. It is Easy(tm) but not worth the effort compared to either PeachTree or QuickBooks Pro. Both do full accounting, rudimentary customer management, and full order mgmt. \_ I was also going to reccommend peachtree, just as long as you don't ever intend to become a big (or even medium) sized company, 'cause peachtree is definitely a small business only system (or was 6 yrs ago when i last used it. Things might have changed. \_ How about UNIX based systems? Anyone? Ones that will work with a postgress backend database maybe? or should i not hold my breath? \_ I'm looking at PeachTree and QuickBook web sites. They are also offering online version of the products. Like QuickBase. It keeps customer information in their database and you use a web browser to access it. Anybody used it? Comments? \_ QuickBooks easily does this for you. It isn't the most sophisticated piece of software, but it works. From what you describe, you do not need QuickBooks Pro. And you could perhaps use QuickBooks for the Web, although it only works on Windoze and only works with Internet Explorer (yes, they are lame... don't even get me started). And if you want QuickBooks for cheap ($50), I can get it to you. -phale |
2001/4/24-25 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Languages/Perl] UID:21079 Activity:moderate |
4/23 Anyone know of a pretty print util for Windows 2000? (I had a2ps for so, where can I get it? (Please, no suggestions to change OS.) \_ print utility to do what? \_ Sorry, meant "pretty print" for source code (c++ perl, etc.) \_ You meant something like enscript? If your printer driver supports two pages per sheet, you can simply open your source file as plain text and print with that feature. Otherwise, You can create a template in M$ Word to use landscape orientation, two columns, and a small mono font. Then open a new document with that template and paste in your source code. Then print it. (The latter was how I printed enscript- like output on my 9-pin printer years ago.) Either way, don't forget to also utilize any two-sided printing feature to save even more paper. -- yuen \_ But dumbya told me that cutting down trees is good for the economy. \_ Young troll, remember: to find enlightenment you must hit where it hurts. Ad hominem doesn't hurt anything except your chances of walking the true path to great trolldom. \_ http://gnuwin32.sourceforge.net/enscript.htm \_ Enscript is similar to a2ps--I was under the impression that enscript had been absorbed into a2ps. \_ emacs \_ Wow, emacs sends to the printer? And formats the code like a2ps? Are you sure about this? \_ M-x print-buffer/ps-print-buffer/ps-print-buffer-with-faces do send output to the local or network printer. Don't know about formatting. \_ yes, emacs does format like a2ps |
2001/4/23 [Computer/SW/Languages/Perl] UID:21058 Activity:very high |
4/22 I have some data in an HTML database. I want to display some of it in a mysql table. what's the fastest, easiest way to do this? I don't need to be able to enter data, or do anything fancy. \_ HTML database -> display in MySQL table. Whew. Good thing you're \_ why do you keep deleting references to perl? -tom not using something like HTML for presentation. \_ go find some sample php code. \_ PHP bigots can't stand a real language like perl or c. \_ Oh my God! You mean there's a "language" even more pathetic than Perl?! \_ There are many languages more pathetic than Perl: Active-X, VBScript, J[ava]Script, PHP, ASP, JSP, C#, Pascal, Lisp (and derivatives). \_ Young troll, you will become more effective if your arguments are plausible. Now what plausible argument were you going to use for lisp? \_ lisp? lisp is useful? Please demonstrate a use to me. And no emacs customizations isn't a valid use. I've written a expert system in lisp before and let me tell you that it is severely deluded. a slow useless POS. The list is practically endless. About the only decent languages in existence are C/C++, Perl and Java (and even that is debateable). \_ Without starting a Perl flamewar--why did you list Active-X as a language? \_ LOL, I think he meant COM. \_ I meant (D)COM, which I believe is called ActiveX Contorls or some bs like that. Strictly speaking its probably not a language. \_ http://wdvl.internet.com/Authoring/Languages/Perl/PerlfortheWeb/index6.html Is a pretty good bare bones tutorial on the Perl DBI module. Leaves out lots of details, but it should do for your needs. If you need something more detailed, go to Cody's or B&N and page through the Programming the Perl DBI (O'Reilly) book. -dans \_ PHP made me quite a bit of cash 1 day. - paolo \_ My chevy rules over your Ford. \_ Dude, unless you're talking about your 'vette, you are severely deluded. Chevy > Ford? That's funny. \_ chevy suburban vs. ford expedition. suburban wins hands down. Same can be said for camaro vs. probe and metro vs. aspire. |
2001/4/21-22 [Computer/SW/Languages/Perl] UID:21046 Activity:kinda low |
4/20 Anyone knows of a company where they are hiring Perl developers? \_ sun \_ ActiveState \_ People to develop in perl, or people to develop the perl language tools themselves? \_ People who develop in Perl. \_ There are some openings in Hell. |
2001/4/18 [Computer/SW/Languages/Perl, Computer/SW/Unix] UID:21022 Activity:high |
4/18 I want to filter a file with sed and store the output back into the same file. Is there a way to do this without a temp file? \_ no, if you want to do this use either awk or perl (perferably perl) \_ Please use a language (preferably English). \_ perl -pi -e 's/.../.../g ; s/other/foo/g' file1 file2 ... \_ yes. |
2001/4/18 [Computer/SW/Languages/Perl] UID:21017 Activity:nil 66%like:21064 |
4/17 perl-5.6.1 installed, bugs to mconst. |
2001/4/16-17 [Computer/SW/Languages/Perl, Computer/SW/OS/OsX] UID:21003 Activity:high |
4/16 I have a bunch of ^M s from mac files i transfered over. I'm sure there is a quick and easy way to remove them all, but i don't know how to specify cntrl characters in my script. Someone please point the way. \_ Does vi's :1,$s/<ctr-v><ctr-m>// work? I think emacs also has a remove trailing function. \_ Are you really helping by giving it away? He was 99% of the way there. \_ man tr. Or do a search/replace in your favorite editor. \_ For the hopelessly lazy: tr -d '\015' < file > newfile \_ yes fine, i could come up with "do a search/replace" myself the problem is that i don't know how to write ^M so that my editor can read and match. it. How about i make this specific: perl -pi -e 's/^M/ /g' FILES doesn't work. What do i need to type instead of "^M" or actually pressing the CNTRL and the M key together, so that i can match this char. Does anyone know what the ascii (alt+3) number is for this character or where i can find that? \_ Heh... guess what? "man ascii". "But if you teach a man to fish...." \_ perl -pi -e 's/\r\n?/\n/' FILES this will work for both Mac & DOS formatted files --dbushong \_ Didn't you answer this question like 47 times before? \_ How many times has this been asked on the motd before? \_ just ftp your files over in ASCII mode |
2001/4/9-10 [Computer/SW/Languages/Perl, Computer/SW/Languages/Python] UID:20925 Activity:very high |
4/9 Does anyone here use the Python language on a regular basis? What do you use it for? What is your opinion of it as a language? \_ ML >> Perl >> Python. \_ Tcl >> ML >> ... >> PHP \_ I've seen Python, PHP, Perl, and TCL. 3 of 4 are crap. Got a link for ML? I can decide for myself. \_ http://cm.bell-labs.com/cm/cs/what/smlnj \_ Who is it that keeps putting ML into these Python comparisons? I seriously doubt anyone would consider ML where they were thinking of using either Perl or Python. Might as well put Prolog into these comparisons. \_ Ok! ML >> Prolog >> Perl >> Python. \_ Scheme >> ML >> Prolog >> Perl >> Python >> JavaScript \_ ML >> Scheme. Scheme doesn't have a type system. \_ so what? you making fun of it? it gets by just fine without one asshole. \_ Silly troll. I programmed lisp in the industry. I _know_ how bad runtime type errors are in lisp-like languages. Train harder. To answer the original poster's question, Python is a nice language. It's a poor-man's Smalltalk. There are some weird quirks to the language, but i would prefer it to Perl for all but the simplest tasks. |
2001/3/22 [Computer/SW/Languages/Perl] UID:20877 Activity:low |
3/21 Why does perl's open function not error when you try to open a file for reading that is not readable by you? \_ Of course it does. |
2001/3/18 [Computer/SW/Languages/Perl] UID:20833 Activity:high |
3/17 Are there any perl modules to handle command line flags simply? I want something like "if (Flag1.value == foo) then {...}" \_ man Getopt::Std \_ Search for 'getopt' on cpan, there are lots. \_ It's perl. Of course. |
2001/3/14-16 [Computer/SW/Languages/Perl] UID:20774 Activity:moderate |
3/13 does anyone happen to know when/where the python infosession will be on thursday? thank you. \_ Perl >> python \_ ML >> Perl >> python \_ ML >> prolog >> Perl >> python \_ yermom >> ML >> Perl >> python >> ilyasmom \_ Yes, Ilya. \_ a little after 6pm, 306 soda. see the motd.official and/or all the flyers around soda. - chialea |
2001/3/9-14 [Computer/SW/Languages/Perl] UID:20732 Activity:nil |
3/13 How do you change the logging behaviour of sudo after it has been installed? (i want to log all actions taken as sudo). #!/usr/bin/perl -w # 531-byte qrpff-fast, Keith Winstein and Marc Horowitz <sipb-iap-dvd@mit.edu> # MPEG 2 PS VOB file on stdin -> descrambled output on stdout # arguments: title key bytes in least to most-significant order $_='while(read+STDIN,$_,2048){$a=29;$b=73;$c=142;$t=255;@t=map{$_%16or$t^=$c^=( $m=(11,10,116,100,11,122,20,100)[$_/16%8])&110;$t^=(72,@z=(64,72,$a^=12*($_%16 -2?0:$m&17)),$b^=$_%64?12:0,@z)[$_%8]}(16..271);if((@a=unx"C*",$_)[20]&48){$h =5;$_=unxb24,join"",@b=map{xB8,unxb8,chr($_^$a[--$h+84])}@ARGV;s/...$/1$&/;$ d=unxV,xb25,$_;$e=256|(ord$b[4])<<9|ord$b[3];$d=$d>>8^($f=$t&($d>>12^$d>>4^ $d^$d/8))<<17,$e=$e>>8^($t&($g=($q=$e>>14&7^$e)^$q*8^$q<<6))<<9,$_=$t[$_]^ (($h>>=8)+=$f+(~$g&$t))for@a[128..$#a]}print+x"C*",@a}';s/x/pack+/g;eval \_ So, what's the purpose of using "eval" here? -perl newbie \_ RTFM. most single-arg perl commands take $_ as the default arg if they're not given one. so eval at the end evals everything else, which is stored in $_. \_ I know what eval and $_ stand for. I did not ask this correctly I guess. I am wondering what's the purpose of doing this fancy '$_=".."; eval' stuff? Looks like redundant to me. \_ (1) obfuscation; (2) compression by being able to use "x" instead of "pack+", which occurs frequently in the actual executed code (i.e. note the s/x/pack+/g). -alexf \_ just being clever about it. It isn't strictly required but it sure looks cool. |
12/25 |
2001/1/29-31 [Computer/SW/Languages/Perl] UID:20461 Activity:moderate |
1/28 http://perltidy.sourceforge.net This is a "beautifier" for Perl (like indent(1) for C). It hasn't been really announced yet; the author would like it if people tried it out to see if they can find real problems before it is announced to the world. (Perl is hard to parse, so it will always be possible to write code that perltidy treats differently than perl does; but it should work on all code that people actually write, including obfuscated perl contest entries.) --Galen \_ but perl is all about writing cryptic one-liners. \_ The perl beautifier will remove all the carriage returns for you. \_ no, it just converts it to java \_ Seems to work pretty well; I'd like an option to make/leave lists/hashes as: %foo = ( a => 1, b => 2 ); instead of: %foo = ( a => 1, b => 2); --dbushong \_ That's the default; did you mean you want the two-line version? \_ Sorry, without the trailing comma too; corrected above. --dbushong \_ the perl whore \_ You know, Dave, Java would be faster for that. -Ilya \_ DA STARS. WE WANT TO KNOW ABOUT DA STARS. \_ You show me that Java is faster for declaring that hash, in terms of "faster to write" or "faster to run", and maybe I'll believe you. |
2001/1/24 [Computer/SW/Languages/Perl] UID:20411 Activity:kinda low |
1/22 In perl, how do I read a set of vars from a .*rc file? In bash, I'd just say ". $HOME/.foorc" and all the varname=value pairs come into scope. What's the perl equivalent? \_ perldoc -f require perldoc -f use \_ Both of these require the use of perl's package syntax in the .rc file. I'm looking for something simpler. \_ They don't -- just write your rc file with lines like $variable = "value"; \_ require 'filename.pl'; ... use the variables you set in that file... The only trick is that filename.pl has to end with a positive value... just make the last line of the file: 1; ##dbushong 1; \_ Ladies and gentlemen, we have a winner! |
2001/1/18-19 [Computer/SW/Languages/Perl] UID:20367 Activity:low |
1/19 How do I read from an input pipe in sh or perl? I need a little script that can read in "echo foo | myScript" \_ you use 'read' in sh, and <> in perl. i.e while (<>) print $_; is perl equivalent to /bin/cat \_ In perl: explicit is <STDIN>; magical is <> \_ In csh: accessing $< gives you a line from stdin |
2001/1/17 [Computer/HW/Languages, Computer/SW/Languages/Perl] UID:20342 Activity:kinda low |
1/16 Has anybody written perl scripts that translate CAD related data files (all in text) from one format to another? Or know of one? I'm just looking for an example of this type of program. Thanks. \_ Which CAD software? \_ from some PC program whose name I don't remember to berkeley's MAGIC. The translation is straightforward. There's a set of keywords and numbers following keywords. I'm looking for an sample program that does something similar. \_ Magic was a piece of shit. Even with its so-called "user friendly" Tcl/Tk GUI Max it still stunk. Fortunately, in the real world, you use real CAD tools (which unfortunately Synopsis will charge you 7 digits for). |
2001/1/7-16 [Computer/SW/Languages/Perl] UID:20259 Activity:nil |
1/5 I hate motd censors. - cronjob + scp + perlscript. \_ I squish motd bots. - root \_ You need Tom's permission to post anything not directly interesting to Tom. I think he's writing a CGI to auto-grant permission based on twink points but you'd have to ask him for details. |
2000/12/6-8 [Computer/SW/Languages/Perl, Computer/SW/Languages/Misc] UID:20028 Activity:low |
12/6 anyone know how of a script to extract from an xml file and save as some type of formatted text? or can you point to where one should look online for that kind of info? \_ uh, xml is a formatted text file. what do you really want to do? \_ for instance, extracting tag information. input /whatever to look for it and return lists of values following the named tags... \_ You can really write this yourself in C or Perl, but there is free XML parsing code in Java \_ Look on CPAN, I'm sure there's plenty. \_ XSL style sheets |
2000/11/16-17 [Computer/SW/Languages/Perl, Computer/SW/Languages/Functional] UID:19806 Activity:high |
11/16 I have two arrays a1 and a2 and I need to create an array a3 that contains all the elements in a2 that are not in a1. I'm doing this by removing elements in a2 that are in a1, but this is an operation of nm complexity (where n is number of elems in a1 and m is number of elems in a2), is there a better way to do this? - not a cs geek \_ are the arrays sorted? can they be? (becomes (m+n) lg m problem) \_ I could sort the arrays, but the contents are strings, so I'm not sure what difference it would make. \_ This is a O(size(a1) + size(a2)) operation. Create a hashtable. Go through a1, and hash the elements. Now go through a2, and insert an element into a3 if it is not in the hashtable. This is an entry level coder interview question. -- ilyas \_ I see. Thanks. \_ can you give me an example of a suitable hash function? Thx. \_ google. Here is the first result of my search: http://burtleburtle.net/bob/hash/doobs.html \_ this is confusing. can you give me a clear example, pls? Thanks. \_ Train harder, grasshopper. \_ Someone said this was an interview question. Is there a simple enough solution that you can write out for the interview? \_ There is, but I will not write it out for you. Firstly, because most interviewers are interested in an algorithm, not an implementation, and secondly because you are lazy, and I have no desire to do your work for you \_ I'm still confused as to why hashing is the solution. What if your array values were int's? Is hashing still better? By the way, you need to be less presumptuous, among other things. \_ I don't think I am presumptuous. I think I am being very polite, patient and helpful. You, on the other hand, are acting like an immature, impatient, ungrateful, lazy prick. For your information, one can come up with 'reasonable' hashing functions for arbitrary data structures (java does something like that). \_ You're getting free advice, you should be thankful you've gotten this much information. -someone else \_ There is something wrong with you. Do not think because you give free advice that you can be an asshole at the same time. \_ yer the asshole who said I was presumptuous. -someone else #2 \_ I hate ungrateful dumbasses who think that people owe him an answer. \_ The answer is on the WWW. Look it up. \_ found it on google. Its in the perlfaq. \_ (defun find-common (a1 a2) (mapcar (lambda (elm1) (setf (symbol-plist elm1) (cons 'marked (symbol-plist elm1)))) a1) (prog1 (mapcan (lambda (elm2) (if (eq (car (symbol-plist elm2)) 'marked) (list elm2))) a2) (mapcar (lambda (elm1) (setf (symbol-plist elm1) (cdr (symbol-plist elm1)))) a1) )) |
2000/10/17-18 [Computer/SW/Languages/Perl] UID:19505 Activity:high |
10/17 What do i have to change in my apache configs to allow users thier own cgi-bin under ~/public_html like it is here on Soda? \_ put 'Options ExecCGI' in the section marked with '<Directory /home/*/public_html>' \_ Thanks, i'll try that though it doesn't seem to be the way it is done here. \_ Unix: more than one way to do it. \_ Perl: many wrong ways to do it. \_ What does Perl have to do with apache, cgis, or anything else on this thread? Might as well talk about taking your gf to a lap dance sex club or something equally relevent. \_ right and wrong is subjective unless the sys admin says so, cuz they're always right. -sys admin \_ whatever is easiest for the sys admin at the time, is the right way to do it and Perl lets you do things the easy way for now. Code extensibility, scalability, portability, that's for academia. \_ Really? I guess I work at the wrong company since we care about that stuff. Getting other people to extend our scalable framework is how we generate a significant portion of our revenue. \_ You have revenue? Time to switch jobs. \_ Uh, no. I like having a steady source of income and a regular work schedule. \_ Where'd you get the idea that revenue = steady job? Your 9-5 ass can be fired just as fast as <DEAD>myass.com<DEAD>. The guaranteed job days were over decades ago and they weren't so guaranteed then, either. Go check out the market. Go read up on the bogus accounting practices at places like MS and Cisco which require ever higher stock prices to keep their companies afloat on a giant river of hope and accounting mismanagement. Think pyramid scheme. |
2000/8/3-4 [Computer/SW/Languages/Perl] UID:18856 Activity:nil |
8/2 What are the flags to get PERL to tell me what modules are installed? Do i have to recompile PERL in order to user a PM like GD.pm or can i just put that .pm file where it is looking for it? \_ perl -e 'foreach (@INC) { print "$_\n"; }' With perl5, you can use "perl -V" to get this info and more. No, you don't need to recompile perl. Thus the term "module." No, you don't need to recompile perl. Thus the term "module." -alexf |
2000/7/26-28 [Computer/SW/Languages/Perl] UID:18768 Activity:nil |
7/25 SF startup needs clued perl hacker. Mail jobs@viralon.com. -- Marco |
2000/7/18-19 [Computer/SW/Languages/Perl] UID:18709 Activity:very high |
7/18 Anyone have a perl one liner to list all the files less than an hour old in a directory? \_ man perl. \_ perl -MFile::Find -e'find(sub{print if (-M _)*24<1},".")' --pld \_ perl -e 'system("man find");' subday granularity short of using the "newer" switches. in pl you can do something like: \_ ls -altr | tail -50 | more | eyeballs \_ eyeballs: Command not found. \_ Eyeballs was part of my standard install. \_ mine too, but then I got owned through an exploit of a hole in libchernobyl 0.1, and the bastards deleted it. can you send me a copy? \_ Sorry. License violation. You'll have to reinstall. They're not open source. \_ AW FUCK! \_ i dont think there is a simple way to use find to get subday granularity short of using the "newer" switches. in pl you can do something like: $ageday = (-M $FILE_TO_STAT); $agehrs = $ageday * 24; $agemin = $agehrs * 60; $agesec = $agemin * 60; --psb \_ psbesque formatting fixed. -motd formatting demigod \_ i used to have a lot of respect for psb. it's all gone now \_ Watch it buddy! Don't dis the psb formatting --psb #1 Fan \_ I like 'newer' switches. \_ so a one-liner would look like, eg: perl -e 'while(<{.,}*>) { print "$_\n" if (-M)<1/24; }' [psb, answer the question] \_ or perl -e 'system ( "find . -mmin 60" );' \-boy i somehow missed the -mmin flag. i stand corrected. however it should be -mmin -60 with gnu find.--psb |
2000/7/7-9 [Recreation/Dating, Computer/SW/Languages/Perl] UID:18611 Activity:kinda low |
7/7 Anyone know how to get scan to display the year in the date field? \_ After you're married, are you allowed to scan for dates at your buddy's bachelor party? \_ Only in Perl. \_ Yes. This is mh? There's a bunch of config files for this stuff. Read the man pages and check out the system files. ------------ [that's it, nothing else to see, scuddle along now] ------------ XXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Yep. There was nothing else to see. |
2000/6/23-25 [Computer/SW/Languages/Perl] UID:18530 Activity:low |
6/22 Has anybody tried to write a new mode for emacs? I have a new language and I just need some basic indentation and color. Non of the current modes can be tweaked to suit my needs. Is there a template somewhere I can follow? I would hate to wade through cc-mode.el or perl-mode.el to figure it out. There is just too much stuff in those modes that I don't need. Thanks. \_ I made a mode for Lua starting with tcl-mode.el as a base. tcl-mode.el is pretty intelligible. And next time, sign your name so I can just mail you about it. -mogul \_ Thank you, this will be most useful. -!original poster (as a reminder that motd replies>>mail replies) \_ ML is the standard language. \_ Dude, this is so tired. It *might* have been amusing the first time, now it's just stupid. \_ Marketing is stupid, I agree. \_ ED! \_ WTF is Lua? \_ Lua, WTF? \_ Some people are really really stupid. A) It's obvious from context. B) The first thing that shows up on a google search tells you the answer. <sigh> |
2000/6/1 [Computer/SW/Languages/Perl] UID:18378 Activity:high |
5/31 #!/usr/local/bin/perl @a=(Lbzjoftt,Inqbujfodf, Hvcsjt); $b="Lbssz Wbmm" ;$b =~ y/b-z/a-z/ ; $c = " Tif ". @a ." hsfbu wj" ."suvft pg b qsphsbnnfs" . ":\n";$c =~y/b-y/a-z/; print"\n\n$c ";for($i=0; $i<@a; $i++) { $a[$i] =~ y/b-y/a-z/;if($a[$i]eq$a [-1]){print"and $a[$i]." ;}else{ print"$a[$i], "; }}print"\n\t\t--$b\n\n"; \_ this is fuckingstupid. -ali \_ ali is fuckingstupid. -this \_ i'm with ali | <--------+ \_ in this case I AM ali |
2000/5/23-24 [Computer/SW/Languages/Perl] UID:18326 Activity:low |
5/23 Death to Perl! http://www.segfault.org/story.phtml?mode=2&id=3905b40e-05c0a760 \_ PROLOG! PROLOG! PROLOG IS THE STANDARD! Highly useful language no one ever uses. |
2000/5/18-20 [Computer/SW/Languages/Perl] UID:18291 Activity:nil |
5/18 perl-5.6.0 installed, bugs to mconst. |
2000/5/16-17 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Languages/Perl] UID:18276 Activity:very high |
5/15 I need to write some c++ client/server code using sockets. Is there a nice library to use or do I need to roll my own. I want something which makes it easy to set up a connection and then have the client and server communicate via << or >>. Thanks. \_ Idiot. C++. READ! \_ actually, I have some really sleek Pacsal libraries that I've managed to fine tune for above average performance. If you're interested, post a followup.... \_ If you want to use Java, there is an easy way to do it... look at the Socket class. \_ Thanks, but I was planning on using c++. \_ It's pretty easy to do in Tcl. \_ Idiot. C++. What's wrong with you people? READ! \_ you can buy libraries like Roguewave. Or, you can create your own classes and perhaps buy the Steven's book. \_ Using C code, it wouldn't be hard to write your own << and >> operators. Get some sample C code and go from there. Is this for Unix or another operating system? \_ Might be useful: http://www.gnu.org/software/commonc++/CommonC++.html \_ Thanks. This is exactly the kind of thing I was looking for. Unfortunatl, the documentation is a bit sparse. \_ I know this asian chick that does killer COBOL. I'm sure I could get her to send along a pointer or two if put up your email addy. \_ Perl is perfect for socket programming. Perl is perfect for replacing Java and C. \_ Idiot. C++. READ! \_ Yer welcome. -mogul \_ All non-CC+ replies purged. --not original poster |
2000/5/9 [Computer/SW/Languages/Perl, Computer/SW/Unix] UID:18206 Activity:very high |
5/8 Is there a Visual Basic equivalent to the UNIX system() function? I need to write a VB program to run a bunch of dos commands and report the results to the user. If I had a choice, I would use perl, python, tcl, bash, or something like that, but I need to create a program that will run a standard windows system. Thanks. \_ Yes. \_ Yes. \_ Perl runs on windows just fine, so does the bourne shell. \_ Sorry. What I should have said was that I need a solution which does not involve installing perl, python, tcl, bash or some other tool which is not installed on a standard system. \_ Install gcc and write a C program to do it. \_ Duh. Without installing anything. \_ ShellExecute or CreateProcess - chiapet \_ Shell (command, windowmode) \_ Thanks. Shell seems decent. Is there any way for Shell to return the output to VB? |
2000/5/2-3 [Computer/SW/Languages/Perl] UID:18151 Activity:moderate |
4/32 Trying to use POSIX.pm in perl. I have: >> #!/usr/bin/perl >> use POSIX; But perl complains >> syntax error in file .//wparse at line 2, next 2 tokens "use POSIX" What am I doing wrong? \_ '/usr/bin/perl -v' will tell you. use /usr/local/bin/perl{5} \_ Not sure, but as a side note: POSIX.pm has tons of stuff; just import what you need, e.g.: use POSIX qw(strftime setsid); ##dbushong \_ I switched to /usr/local/bin/perl and it works fine. Any ideas as to why we have two perl binaries? I thought the parsers were very backwards-compatible. Perhaps one should be deleted? -- Thanks \_ Perl 5 is not completely backwards compatibile with 4. Many common scripts have to be updated to use Perl 5. |
2000/4/19-20 [Computer/SW/Languages/Perl] UID:18061 Activity:nil |
4/18 Is there a Perl-DBI for dos/Windows9x machines? \_ yes \_Great. Where can i get it? \_ Install/use activestate perl. http://www.activestate.com \_ perl dbi is the database package right? I know there are really easy to use perl to odbc libs that are standard. Maybe that is perl DBI? I dunno. Been too long. Thank god I don't know this crap anymore. |
2000/4/12 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Languages/Perl] UID:17975 Activity:nil |
4/11 question: if i declare (pseudo code): Interface1 *pInterface1; what do these return: &pInterface1 and *pInterface1? \_ &pInterface1 - the address of the memory location that holds pInterface1 *pInterface1 - the value stored in the memory location whose address is stored in pInterface1 (since you didn't say assuming C - the answers would be very different in another language such as perl) \_ thanks, i really appreciate it. - comdude \_ wow, you people are fast. I see unedited motd and when I edit, someone already wrote this. |
2000/4/11-12 [Computer/SW/Languages/Perl] UID:17973 Activity:moderate |
4/11 If I add in mod_perl, is there anything extra I have to do on the hundreds of *.cgi's files that I created? \_ Yes. There is a guide with the mod_perl documentation that tells you what to do. Mod_perl is MUCH pickier than most Perl programmers. That is to say, your scripts may require a lot of reworking. --sowings \_ I think the most common catch'em (for me) is that my CGIs operated on the assumption that variables == 0 or empty string. Alas, when run under mod_perl, variables tend to have the value from the last time they ran (can't depend on this though), so you need to make sure you always reinitialize things. \_ 1) Good thing you don't write in C (or perhaps you don't write your C this way). 2) This is because mod_perl caches scripts. If the script hasn't changed on disk, the server doesn't have to recompile it. This is what buys you performance. --sowings \_ If you put #!/usr/bin/perl -w at the top and "use strict;" in the code, you'll get a good idea of the changes you need to make. -tom |
2000/4/6-9 [Computer/SW/Languages/Perl] UID:17944 Activity:high |
4/6 I wonder how many bugs will come out once time hits 0xDEADBEEF? \_ 0xFEEDFACE of 0xCAFEBEEF with 0xDEADBABE \_ the fun one will be sep 9 2001. the ascii representation of a time_t will roll from 999999999 to 1000000000, and thousands of lazy perl hacker code will sort lexicographically and launch the nukes. --aaron \_ Damn, why the hell do people (like the guy below) like to tab so far out. What I'm curious about is what will happen to computers once 2^32 seconds have passed by since 1970 (which should happen around the year 2106). What will happen then? Will the world predict a Y2.106K bug that will end the world again? \_ I thought that time_t wraps around in 2037. Anyway, if we are still alive we should all be using 128 bit or larger processors if not quantum computers, meaning that time_t won't wrap for several billion years (?). \_ you must have this much clue to post to the motd... Hey wait, how did you get there. Go back to your basement or something and stop talking outta your ass. \_ It doesn't seem likely that lazy perl code would do this; if you are using "<" and ">" perl will treat the scalars as numbers. You'd have to be explicitly using "gt". -tom \_ He said sort. Perl sort defaults to cmp, not <=>. --dbushong \_ (why does this keep getting deleted?) 0xdeadbeef is a negative number for signed 32-bit ints. 0xdeadbeaf refers to sometime in 1952. for signed 32-bit ints. 0xdeadbeef refers to sometime in 1952. \_ What's so special about 1952? Was that the year dead beef was invented? \_ No, that's what you get when you take 0xdeadbeaf and convert it to a signed decimal (-559038737), and add that many seconds to Jan 1, 1970. That's about 17 years and change. Hence 1952. \_ well duh. I got that part. I'm saying what's so special about 1952? That's like saying that 0xF00DF00D will take us back 1879961613 seconds putting us 59 years back from 1970. Who cares? \_ So what was the question? Do you really believe that there was some cosmic conspiracy to choose Jan 1 1970 so that 0xdeadbeef would be sometime in 1952? What are you asking then? \_ What's so special about 1921? Was that the year food food was invented? |
2000/4/6 [Computer/SW/Languages/Java, Computer/SW/Languages/Perl] UID:17940 Activity:nil |
4/6 C vs. Java vs. Perl comparisons: ------------------ #include <stdio.h> #include <stdlib.h> int fib(int num) { if (num==0 || num==1) {return 1;} return fib(num-1) + fib(num-2); } main(int argc, char *argv[]) { printf("%d\n", fib(atoi(argv[1]))); exit(0); } ------------------ import java.lang.*; class fib { private static int fib(int num) { if (num==0 || num==1) {return 1;} return fib(num-1)+fib(num-2); } public static void main(String args[]) { System.out.println(fib( (new Integer(args[0])).intValue() )); } } ------------------ #!/usr/local/bin/perl5 sub fib { my($num)=@_; if ($num==0 || $num==1) {return 1;} return fib($num-1)+fib($num-2); } print fib($ARGV[0])."\n"; Conclusion: C is still the fastest. Java is not as slow as people think it is. Perl is nowhere close to Java performance. \_ I could an implementation on my TI-85 pseudo-BASIC that will kick the crap out of any of those. Take an algorithms course. That's the conclusion. |
2000/4/6 [Computer/SW/Languages/Perl] UID:17937 Activity:nil |
4/6 C vs. Java vs. Perl comparisons: |
2000/4/5-6 [Computer/SW/Languages/Perl] UID:17936 Activity:insanely high |
4/5 In C/C++, how do you implement "ls" type of functionality without using a "system" call? Where can I get the source code for "ls"? \_ http://ftp.gnu.org, <DEAD>ftp.freebsd.org<DEAD>, http://ftp.redhat.com, and fifty million others \_ Your implementation of a directory/folder is system-dependent. Hence you need to use system calls. \_ Okay, found something for WinNT: findfirst, findnext using io.h \_ POSIX/UNIX: opendir/readdir/closedir. Other OS'es: see your OS'es API docs. \_ thanks. but what a pain. why can't someone put a layer on top of that and make it more portable across various OS's. \_ Sun did. It's called "Java". \_ this is a stupid answer. POSIX api *is* supposed to be the multiplatform solution. opendir/readdir/closedir are very much multiplatform and are definitely not UNIX only. if your OS doesn't support it, looking for YET another "standard" library is asking for lack of portability. -ali. \_ Java is better than POSIX. POSIX compliance is limited mostly to UNIX systems (and WinNT) while Java is usable on Mac,Win*,*nix and others. And once you compile your java files into classfiles you can give them to someone on a different platform and they can run it without needing to recompile. \_ Use ACE! It works everywhere and does everything. ACE will rule the world! ACE ED will be the standard editor/library/os/everthing. \_ Fuck Java, use Perl! \_ Java has real OO, not some stupid hack like in Perl! We should ditch Perl5 and go back to Perl4. If you need OO, then use Java. Also if your are doing web stuff that accesses It's also a royal pain to set up with any real webserver. ldap servers or db servers Java (servlets) are much better than Perl cgi. And don't give me that crap about fast cgi or mod_perl. There are several problems with reusing server connections. \_ OO is a style of programming that need not be supported by language constructs. \_ Uh.. crack. Have you actually looked at the performance numbers for mod_perl vs. java servlets? Java loses. Heavily. \_ URL? \_ http://www.chamas.com/bench/hello_bysystem.html --dbushong It's also a royal pain to set up with any real webserver. \_ This page is bs and it even states that: "These benchmarks do not represent real world scenarios." Perl is faster for simple form processing and basic text output. But how many cgi's do that anymore. Most are wrappers for accessing services like a db or ldap or corba or a tib. Perl loses here. Benchmark a java servlet that does jdbc odbc access using a connection pool against a perl cgi that needs to open a db connection every time it is invoked. Java beats the pants off of perl for most transactions. Same for LDAP. I know that Java is better since I worked to convert a large perl cgi based product (worked on the perl cgi's in the original version) to java servlets for Cisco and we got ~ 1.5 to 2x improvement on the server side performance. Setting up JRun or Appache JServe isn't that hard. If you think JRun's setup is hard your admin fu is really weak. The most recent versions required only 5 lines in httpd.conf. \_ JRun is an utter piece of shit. I had to restart it once a day when it barfed all over itself. \_ I haven't had this problem for the last few versions. But I'm using JServe now since I don't like Alaire's upgrade policy regarding old Live cust. They asked me to pay full price for the latest vers. mod_perl does not need to open new database connections every time; that's what Apache::DBI is all about. And saying you got a performance improvment over "perl cgi" is idiotic. Of course you did, the compile/exec penalty on non-mod_perl is lethal. \_ We were using mod_perl, but Apache::DBI wasn't stable enough for our needs. \_ POSIX API exists for most OS's. \_ Tcl/Tk also has platform independant APIs for this kind of thing. I've used Tcl/Tk and I highly recommend it. -emin \_ Tcl/Tk is pretty junky compared to Perl. If you need to use a scripting language use Perl or Bourne Shell. \_ there really is no point in doing Tcl in my opinion. Instead you should use python. It's easier to learn, it's easier to write wrappers for your C code in it, it runs faster (actually, i don't know about tcl8.0), and it's got builtin support for OO. -ali \_ I checked out the python web page and it does seem pretty nifty. I'll try using it next time instead of Tcl. Thanks. -emin \_ Any language that uses white space for scope is pretty junky. Next they will dictate the columns that I can use. Fortran anyone? \_ tcl + python are academia languages and are USELESS PERL R3WL$!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
2000/4/1-3 [Computer/SW/Languages/Java, Computer/SW/Languages/Perl] UID:17907 Activity:high |
3/31 how can i tell whether a Java object is an array? ie applet.getClass().toString() -> java.applet.Applet (new int[] { 1, 2, 3 }).getClass() -> ? \_ Arrays aren't objects, they are primitive types. Your question betrays a serious lack of understanding of what an object is, and an array is. I hope you haven't graduated. \_ Your reply betrays a serious lack of experience programming in Java, Java isn't my first choice, but that's like one of the first principles you learn coding in it. \_ "Java arrays are objects" -- the opening words of Chapter 10, Arrays, in the Java Language Spec. \_ nevertheless, you can do: 1) (new int[] { 1, 2, 3 }).getClass() 2) Object o = (new int[] { 1, 2, 3 }) 3) BUT NOT Object o = 1 so its not an object... ??? :p go read: http://www7.software.ibm.com/vad.nsf/Data/Document2712 and you'll see the reason for the question. its a big kludge by Sun \_ array.getClass().isArray() -> true hope you haven't graduated either ;p \_ the String class supports '+' and '+=' \_ that's just syntatic sugar, but object vs primitive in Java is a Real Big Mess(TM) \_ "Java=C++--" - Bill Joy \_ GO Smalltalk!!! -purist \_ PERL 5.6!!! \_ ED! ED is the Standard Language! \_ so how can you tell if an ED! object is an array? \_ Its all just memory anyway, just toggle the right bits in RAM. How hard is that? (Not hard at all, if you have ED fu!) \_ It's easy in PERL. \_ This thread looks similar to Bresenham's algorithm. \_ I wrote that in PERL with ED once, just for kicks. \_ NO, WINDOWS. WINDOWS IS THE STANDARD EVERYTHING. \_ Microsoft invented the Internet. \_ I heard that BG wrote PERL with an early version of ED. \_ cool. \_ NO, MAC OS X WILL SQUASH WINDOZE SOON. LONG LIVE APPLE-NeXT \_ NO, WINDOWS. WINDOWS EATS EVERYTHING FOR BREAKFAST. IT IS THE SOLUTION TO ALL YOUR PROBLEMS. NEED AN ABORTION? WINDOWS WILL TAKE CARE OF IT. NEED TO HAVE YOUR CAR FIXED. WINDOWS WILL TAKE CARE OF IT. BILL GATES IS MY GOD. \_ NEGATIVE...THE NEW HYBRID OF UNIX AND THE MAC OS WILL TURN THE TIDE IN IN THE MAC/PC WARS FOR YEARS TO COME. MACS WILL NO LONGER JUST LOOK GOOD... THEY WILL ESTABLISH A NEW PARADIGM IN PERSONAL COMPUTING. STEVE JOBS, THE SMELLY-ASSHOLE, DAUGHTER-DUMPING, "REALITY DISTORTION FIELD MAN" IS THE TRUE MESSIAH WHO WILL RESTORE BALANCE TO THE FORCE. REMEMBER: THERE CAN ONLY BE ONE. |
2000/3/30-31 [Computer/SW/Mail, Computer/SW/Languages/Perl] UID:17887 Activity:low |
3/29 Sr. UNIX SA needed at Sendmail, Inc. in Emeryville. email christine@sendmail.com if you're interested. Oh, and engineers with clue in C and/or Perl, too. \_ Make sure you know at least three Perl bugs. \_ Doesn't handle garbage collection correctly. -- ilyas \_ It's ugly. It's slow. Compiling is broken. \_ You just described sendmail. \_ what's your point? But anyway, I'm talking about byte-code compilation. You can't "compile" a .cf file to binary, last I checked. \_ Jealous python developer! \_ Nice replython necktied beaver -(fucker) \_ Make sure you can read minds during the interview. They don't know how to ask a question. And woe be unto those who provide _a_ correct answer, but not _the_ correct answer as per the required ESP. \_ when I interviewed they just asked me really picky perl quesitons that said nothing about my ability as an engineer. \_ it probably said a lot about your ability as an engineer. happy hunting! \_ I suppose one of the requirements is to be able to write /etc/sendmail.cf from scratch, using /bin/ed at 60wpm ? \_ close. But use cat. \_ cat is for wimps. Use a magnet and toggle the bits on the correctly hd platter. \_ They let you use a magnet in your interview? They must be dropping the standards. I wasn't allowed to use a magnet. \_ I made my own electro-magnet using the iron in my interviewers blood and the electricity from the wall socket. I solved the problem but I wasn't hired. \_ DISCRIMINATION! you need to sue them because they are practicing religious discrimination against voodoo |
2000/3/24-25 [Computer/SW/Languages/Perl] UID:17845 Activity:moderate |
3/24 Can you have nested parenthesis in perl regular expressions? If so, what is the rule for assigning the corresponding $d variables? \_ Yes: you count open parens. So in /(foo(bar))/, $1 is "foobar" and $2 = "bar". \_ no. \_ yes. \_ xor. \_ Why don't you post the code and what you _think_ it should do and maybe you'll get a real answer. Perl being perl, your question can be interpreted in more than one way. |
2000/3/18-19 [Computer/SW/Languages/Perl] UID:17797 Activity:high |
3/17 Been RTFM, but I can't figure this out in Perl: How do I search a string for a specific pattern, eg. [0-9][0-9]/[0-9][0-9], and return just that pattern to another variable? \_ No need to make it personal: $str =~ /([0-9][0-9]\/[0-9][0-9])/ ; $v = $1 ; \_ $str =~ m|\d{2}/\d{2}|; $v = $&; \_ You are telling me it took less effort to write this motd question than to look this up? \_ It's not a trivial thing to look up. -tom \_ I was reading the camel book. I still haven't come across where it says matches go to $1. But thanx to the person who answered! \_ You must not have read very far. Its on page 28 of the pink camel book. \_ Oh fuckin' spare me. Like anyone except nweaver can memorize the whole book or is willing reread the goddamn thing for something that may or may not be near the beginning. \_ I'm not nweaver, but I've been using perl since v3.0 and I did perl programming for a living for several years before moving to java/c++ and now back to c. \_ s,nweaver,mconst,g \_ yes, he's more nerdy than smart. \_ Get real. This is totally trivial. This is one of the first perl-ish things I learned. -not nw/mc \_ So exactly how advanced does a question have to be so it can be asked on the motd without flames? Heck, if a question is hard, it shouldn't even be asked cuz we're all so smart here. This question may be trivial or basic to some, but not to everyone. Telling the guy he's stupid for not being able to find it in the book is pointless & childish \_ It can't be helped...no matter how intelligent they may be, you have to remember that at heart, too many csua-ers are immature egomaniacs...*sigh* \_ It's easy to look up if you know what it is. If you don't, what do you look up? "pattern matching" is a huge topic. -tom \_ It's only one chapter. Read it. \_ or, another way: ($v) = $str =~ m/($pattern)/; if you couldn't find this in the manual, you didn't look -- it's one of the basic features of regular expresions. it's also easy to find in the camel book. or : 'perldoc perlre' -kurtz, working with perl now, though i'd rather use java or c \_ It apparently wasn't spoon fed enough from the book. \_ Oh, yes, "perldoc perlre" should be so obvious to a new perl user. |
2000/3/17-19 [Computer/SW/Languages/Perl] UID:17788 Activity:nil |
3/17 Which of the available public www libraries for perl are better, for general purpose? (Not to complicated yet have a good enough selection of features.) \_ Just get the standard www from cpan. Everything else web related requires it anyway. Should almost be a default install item. |
2000/3/16-17 [Computer/SW/Languages/Perl] UID:17782 Activity:moderate |
3/16 When I do some pattern Matching in a Perl script on the string in the arguement $_[0] to a subroutine, it seems that $_[0] itself gets modified. Is this normal? I thought backrefrencing affects $digit but not the argument array @_. \_ "argument" \_ just have a temp value to preserve it before you call the subroutine. some of the mysteries of perl seem to be not clear no matter how many times you scour the O'Reily series \_ I did try that and it worked and I concur with the observation about perl in general. It perhaps shows how match (not substitution) really works. \_ @_ is passed in by reference. |
2000/3/16-17 [Computer/SW/Languages/Perl] UID:17775 Activity:nil |
3/14 Is there a UNIX utility that, when given pw and salt pair, will give me a /etc/passwd|shadow equivalent of crypt(pw,salt)? \_ its called perl. \_ something like: perl -e 'print crypt ( "$salt", "$pw") . "\n" ;' \_ ("$pw", "$salt") \_ Can't ed do this? |
2000/3/13-14 [Computer/SW/Languages/Perl] UID:17752 Activity:nil |
3/12 What are good intro./ref. on the net for perl with emphasis on www related programing among the zillion found by search engines? \_ http://www.cpan.org \_ http://perl.apache.org |
2000/3/6 [Computer/SW/Languages/Perl, Computer/SW/Unix] UID:17694 Activity:nil |
3/5 I'm trying to configure majordomo but I keep getting this error: ----- Transcript of session follows ----- wrapper: Trying to exec /usr/lib/majordomo/-c failed: No such file or directory Did you define PERL correctly in the Makefile? HOME is HOME=/usr/lib/majordomo, PATH is PATH=/bin:/usr/bin, SHELL is SHELL=/bin/sh, MAJORDOMO_CF is MAJORDOMO_CF=/etc/majordomo.cf 451 "|/usr/lib/majordomo/wrapper majordomo"... Operating system error I've looked in /etc/majordomo.cf and found nothing that would cause a non-existent program like -c to execute. Any ideas? \_ well, duh, Did you define PERL correctly? |
2000/2/28-29 [Computer/SW/Languages/Perl, Computer/SW/Languages/Java, Computer/Theory] UID:17642 Activity:insanely high |
2/28 If the push-down automton can accept the language consisting of all words in the form (a^n b^n, n=1,2,3,...), how come no pushdown automaton, deterministic or non-deterministic can accept (a^n b^n c^n, n=1,2,3,...)? How would a linear bounded automaton accept this language? \_ Just write a perl script for some computer. Make k large enough \_ Do you own homework. to make 3*n*k be equal to the RAM size of the computer. \_ 'your' \_ 'typo' \_ 'idiot' \_ Think of this the next time you typo, idiot. "That's how." \_ and people wonder why the csua is a sysadmin farm \_ pumping lemma pumping lemma pumping lemma, hehe. \_ Do your own homework. \_ Are you saying no one has shown that it can, or are you saying someone has formally proved that it can't? \_ "Someone" has formally proved that it can't, and YOU CAN, TOO! With just a small 4-unit investment into an intro complexity class, YOU TOO can go around saying cool words like "pumping lemma", "LBTM", "Savitch", and "EXPfuckingSPACE." Take 172, and CHANGE YOUR LIFE FOR THE BETTER! -alexf (real answer: pump) \_ I did take 172 in Spring '91. I just had a lousy professor (Anvari). \_ How relevant is complexity, architecture, automata&languates, logic&systems design, theory of computation? NONE. I took a c++/Java class and now I'm making 80K/year. -not CS major \_ relevant to what? just because most people in computers dont need to understand fundamentals doesn't make it important. this is like all those idiots who think that because they make tons of money in software hardeware is useless. without people to concieve of new kinds of computing devices who understa nd theory and people to build those devices, you would not have anything to work on for your 80k/yr. no one is going to pay you 80k/yr to write addition algorithms on Babbage's difference engine. not relevant to *your*life != not relevant. \_ I happily make tons of money in a non-hardware field and fully appreciate all the hardware toys that come my way. Not a CS major and making more than the clown above who doesn't get it. Every advance in either software or hardware is good for everyone's bottomline. \_ Is your code maintainable and extensible? Probably not... \_ Are you in school and making +80K? Probably not. Are you in industry and making +80K? Probably. \_ Industry is for brainless people and academia is for brainy people. Industry sucks and academia rules. B1FF G0 BAC|< 2 SK00L!!!!!!! \_ "I work for academia and get paid less to do less, therefore I am morally superior and more intelligent than my industry counterpart." This is such a total crock. It was hard to get a good first industry job coming from academia because in industry they know the book worms don't know how to produce, can't work and can't get along well with others. Academia isnt even academia anymore. How many rooms and buildings are named after companies or CEO-ish sponsors? How many projects on compas are paid for in whole or in part by industry? You think that's free money from the goodness of USA INC's heart? Academia is the cheap research arm of industry, today. Traditional academics are dead. Long dead. \_ Idiot. It's the long term research in the industry that is dead. Go away, you superficial software drone. |
2000/2/22-23 [Computer/SW/Languages/Perl] UID:17585 Activity:high |
2/21 Quick question: For married couples, does filing jointly or filing separately yield lower tax? Roughly how much difference? Thx. \_ Yes, lots. \_ in general, if both people work and makes comperable amounts of money, filing separately is better. \_ It isn't called the Marriage Penalty Tax for nothing. -married \_ Yeah, but the way it is now it encourages one person to stay home and take care of the kids. It's only a penalty if both are working. Tragic headlines from ABC news today: PERL GUNMAN SLAYS 2, HURTS 8 IN MALL RAMPAGE \_ Just think of how many innocent lives would have gone unscarred if he'd used awk, cat, and sed: he'd have wasted so much time trying to pipe the output of this into the output of that and worrying about whether or not he was using sh or csh that the authorities would have apprehended him before he'd done any damage. Languages should only be in the hands of those who undergo regular psychiatric evaluation and who are properly licensed by the government to use them. BAN PERL NOW!!! \_ I agree. Most people I've met who are hardcore use Perl/use Linux/ride bike types are definitely in need of regular psychiatric evaluation. \_ Love my car, hate bikers, really hate linux fanatics, and use perl everyday and loving it. Am I suffering from some sort of MPD? Is there a 12 step program to turn me into a full-on raving bike riding linux fanatic? Thanks, motd wisdom! --seeking help \_ i'm guessing the first step involves reading a man page, and probably several other steps involve RTFMing. just a guess. \_ It is inevitable that something like this would happen sooner or later. This is what happens when you give away software to anybody on the Internet. This open-source stuff has gotten out of hand. There should be a 3-day cooling-off period with in-depth background checks before letting anyone download Perl source code. I've known of young 12-year old kids downloading Perl and then going out and killing children and parent processes, breaking loops using 4 different types of commands, mixing scalars and other data types... Dont get me wrong -- when I was growing up, we consumed our fair share of stuff like sed/awk/grep/csh/sh. But things were more innocent back then -- sure, a few guys I know did C, but we never had this stronger, addictive scripting stuff like Perl -- and it was not as widespread. Now with the Internet, video games and Linux, anybody can get this stuff, and they dont know how to handle it. Sure, the naysayers will try to argue that they have a *right* to have Perl in their home and on their computers. Well, recent studies have shown that a (perl)loaded computer in the home gives you a 68% increased risk of shooting yourself in the foot. \_ You PC liberals are always trying to take away rights guaranteed by the US Constitution!!!! It is our right to bear Perl. (1st amendment) It is our 1st amendment right to bear Perl. \_ I dont just mean for PC's but even Macs and Sparcs. And i think you mean the second amendment. The first is for freedom of religion and expression. is for freedom of religion and expression. \_ Not 2nd! It is the 1st amendment: Freedom of \_ Not 2nd! I said 1st amendment -- Freedom of regular expressions. \_ You don't have the choice to file separately. \_ You don't have enough clue to hold 2 brain cells together. Go read form 1040 and try again. \_ hey! that's mean! \_ I read it every year. And your point was...? \_ Note the part where you choose "Married filing jointly" or "Married filing separately" \_ Yup. And...? \_ Then you do have the choice to file separately. |
2000/2/21-22 [Computer/SW/Languages/Perl] UID:17582 Activity:very high |
2/21 Tragic headlines from ABC news today: PERL GUNMAN SLAYS 2, HURTS 8 IN MALL RAMPAGE \_ Just think of how many innocent lives would have gone unscarred if he'd used awk, cat, and sed: he'd have wasted so much time trying to pipe the output of this into the output of that and worrying about whether or not he was using sh or csh that the authorities would have been able to apprehend him before he'd have done any damage. Languages should only be in the hands of those properly licensed to use them. BAN PERL NOW! would have apprehended him before he'd done any damage. Languages should only be in the hands of those who undergo regular psychiatric evaluation and who are properly licensed by the government to use them. BAN PERL NOW!!! \_ I agree. Most people I've met who are hardcore use Perl/use Linux/ride bike types are definitely in need of regular psychiatric evaluation. \_ Love my car, hate bikers, really hate linux fanatics, and use perl everyday and loving it. Am I suffering from some sort of MPD? Is there a 12 step program to turn me into a full-on raving bike riding linux fanatic? Thanks, motd wisdom! --seeking help \_ i'm guessing the first step involves reading a man page, and probably several other steps involve RTFMing. just a guess. \_ It is inevitable that something like this would happen sooner or later. This is what happens when you give away software to anybody on the Internet. This open-source stuff has gotten out of hand. There should be a 3-day cooling-off period with in-depth background checks before letting anyone download Perl source code. I've known of young 12-year old kids downloading Perl and then going out and killing children and parent processes, breaking loops using 4 different types of commands, mixing scalars and other data types... Dont get me wrong -- when I was growing up, we consumed our fair share of stuff like sed/awk/grep/csh/sh. But things were more innocent back then -- sure, a few guys I know did C, but we never had this stronger, addictive scripting stuff like Perl -- and it was not as widespread. Now with the Internet, video games and Linux, anybody can get this stuff, and they dont know how to handle it. Sure, the naysayers will try to argue that they have a *right* to have Perl in their home and on their computers. Well, recent studies have shown that a (perl)loaded computer in the home gives you a 68% increased risk of shooting yourself in the foot. \_ You PC liberals are always trying to take away rights guaranteed by the US Constitution!!!! It is our 1st amendment right to bear Perl. \_ I dont just mean for PC's but even Macs and Sparcs. And i think you mean the second amendment. The first is for freedom of religion and expression. \_ Not 2nd! I said 1st amendment -- Freedom of regular expressions. |
2000/2/17 [Computer/SW/Languages/Perl] UID:17531 Activity:high |
2/16 Perl Question: Under perl5 does local() do anything or do you have to use my()? \_ "When in doubt, use my. When not in doubt, think twice, and then use my." local() has very limited applications and can almost always be replaced by my. \_ Certain variables cannot be my'd. Basically, think of local as "assigning a temporary value", and my as "creating a private variable." See perlsub, like the poster below suggests. -brg \_ Use local for dynamic scope, my for lexical. \_ And use perlsub(1) for a detailed explanation of exactly what this means. \_ Thanks this had the explanation I needed. Basically, in perl5 I need my() whereever I used to use local(). \_ Go back to CS 60a/61a if you don't know what this means. Do not pass 164, do not collect diploma. \_ Go read http://www.cpan.org you idiot. \_ This is a language issue, moron. CPAN distributes packages. \_ Yes, RTFM before wasting people's time. CPAN has, among other things, the entire perl manpage in convenient html form. Idiot. \_ THE MOTD IS FOR PEOPLE WHO WANT TO WASTE TIME. DUH. \_ It's only a waste of a person's time if that person chooses to respond. And even then, that person may not find it a waste. How much time did you waste to respond anyway? \_ You must be a fellow tweaker. --tweaker \_ I admit it. I tweak a lot. |
2000/2/4-5 [Computer/SW/Languages/Perl] UID:17428 Activity:moderate |
2/3 For people who know Perl intimately: Does anyone know why system("echo hello world |& tee hello.log 2>&1"); does not work? \_ Not perl, sh: you meant "echo hello world 2>&1 | tee hello.log". \_ Use perl's internal pipe mechanism, it'll work faster. \_ the problem is you dont understand that the 'system' function invokes its argument with /bin/sh, not csh. -ERic \_ That's not even csh, it's some strange hybrid \_ It's /bin/msh. Don't recognize it? |
2000/2/3-5 [Computer/SW/Languages/Perl, Academia/Berkeley/CSUA/Troll] UID:17420 Activity:high |
2/3 Does emacs automagically understand lines like the following or do I have to do something special in .emacs? How can I get emacs to automagically insert these lines at the start of all my c and tcl files? /*-*-Mode:C++; c-basic-offset:8; tab-width:8; indent-tabs-mode:t-*-*/ > 2/3 What is the difference between flamebait and a troll? \_ Use perl. 2/3 What is the difference between flamebait and a troll? \_ Semantics? Or a troll is a post to gain attention, and flamebait is a post intended to provoke vehement reaction. I dunno really. \_ flamebait is something stupid. "MS-DOS is the best OS". A troll is something inflammatory posted deliberately, about a 'big issue'. But usually posted in the guise of an "innocent" poster. eg: "Why does the army let fags in anyway?" \_ No. A troll is a descriptive term for a person who posts flamebait. Flamebait is a post intended to provoke a vehement reaction. Trolls post flamebait. I know because I'm one and loving it. --flamebait posting troll \_ troll describes both the idiot and the idiotic post. -tom \_ WTF does that mean? Signyerposts Tom. I signedyermom. \_ That means "Use perl." \_ Is perl a new text editor? I typed perl, but nothing happened. \_ Inline insertion/replacement with perl. \_ ED! ED! ED is the STANDARD! Text Editor. |
2000/1/26-27 [Computer/SW/Languages/Perl] UID:17337 Activity:very high |
1/26 Some friends of mine are having problems with memory management in Java. Is there a way you can force garbage collection in Java? Alternatively, is their a way you can do memory allocation similiar to C/C++ where you can explictly allocate and deallocate stuff so that you aren't at the mercy of the garbage collector? \_ java 1.1: System.gc(); System.runFinalization; in that order, to force garbage collection and call all object finalize() methods. \_ Does that actually FORCE garbage collection, or does the system just treat it as a suggestion? Thanks. \_ depends on the java VM. The ones I've worked with actaully do a GC when you ask for one, but this is not required by the language spec. - seidl \_ Are you sure the problems are caused because the VM isn't doing a gc? You could have objects which you think are dead, but are still referenced and therefore not up for GC. You'll need to use some tools to figure out. Also, the VM you are using is important. Some Java VMs out there use conservative gc, in fact I think all the Sun VMs before HotSpot (which has an exact garbage collector) used conservative gc. With conservative gc's, it's possible to have objects which are collectable, but the garbage collector isn't *sure* they are collectable, so to be safe it doesn't collect them (this can not happen with an exact collector). \_ Dude, if garbage collection is so complicated and delicate, what the heck is the point? If I'm going to worry about memory management with GC, why not just use new and delete? New and delete are nice and simple and you don't have to worry about all this weirdness; you just clean up after after yourself. \_ Implementation of GC is complicated and delicate, but the use of a GC'd runtime system isn't. Or at least, it shouldn't be -- the problem here is that the people who originally designed an implemented Java are morons (if you need any more proof, look at java.util.Date). When using any reasonable garbage collector (like one in any Smalltalk or the Java HotSpot), you just make new objects and the garbage collector will reclaim when they can no longer be used. Now, you could make a programming error where something you think should no longer be useable still is, but if you have good programming habits, that shouldn't happen very often. Far less often than memory leaks with malloc, free. \_ Also, if you set the variables' value to null I believe it will be marked for garbage collection. Of course, this won't _force_ gc. \_ This is a myth -- nulling vars does not help gc. Either you need the objects in those vars, in which case they should not be up for gc and they should not be null (of course); or you don't need them and you don't need the class holding on to those variables, so the root class should be up for gc and its ivars should be up for gc also. I guess the above is not true if you have a class that is long lived but puts objects that it only needs for a short time into an variables, but that *probably* is a bad design. \_ Perl has great GC mechanism, is easier to program (little error \_ No. The way you wrote it, either meaning was valid in English. See you at the end of English 1A. Do not pass Go. catching code required), is portable, and has BETTER GUI designer (Perl/Tk). It is also OO (Perl5). GO PERL! \_ Perl OO is about as intuitive as IRS tax forms. It is incredibly awkward as well. \_ Perl is easy for people with a unix background. We're the target audience. Sorry if that's not you. What an insightful comment. Where did I say that I don't _/ have a unix background? I didn't? Then why did you make such an inane statement? Look again: Perl is a great language for many things, but it's impl of OO sucks. \_ Thought you were talking about Perl as a whole, not Perl OO in the second line. \_ Please pay attention. Thank you for playing. \_ No. The way you wrote it, either meaning was valid in English. See you at the end of English 1A. Do not pass Go. \_ Bzzz! Try again. 'It' refers to 'Perl OO' not to Perl. \_ Duh. That was obviously your intended meaning looking back with your able assistance to parse your questionable grammar, but it is not the only valid interpretation of what you said. You are a dunce and a nincompoop. You're not quite at the self-centered low-grade moron level but keep trying and you'll make it soon enough. \_ What part of "It...as well" doesn't obviously refer to Perl OO. \_ "It" can refer to either Perl or Perl OO as used. Consult HS English teacher. \_ "My car door is poorly implemented. It is awkward to use as well." Do you honestly mean that I could be talking about the car or the car door? Moron. \_ Geeks arguing about grammar arcana are always so *cute* . . . I just want to reach out and give the both of you one great big *hug*! \_ thread snipped. here you go: alt.usage.english \_ Perl GC doesn't catch circular structures because it uses reference count GC. \_ LISP! LISP! LISP IS THE STANDARD! Garbage collection language. \_ PERL IS THE BEST, JAVA SUCKS!!!!! -sys adm \_ JAVA IS THE BEST, PERL SUCKS!!!!! -god \_ I don't think god reads the motd. \_ *pshaw* Since when did you have to read the motd to post to it? |
2000/1/20-22 [Computer/SW/Languages/Java, Computer/SW/Languages/Perl] UID:17278 Activity:moderate |
1/20 Where is a good place to find Regular Expression and Regular Substitution package for Java? \_ http://www.javaregex.com -vann \_ Just use perl. \_ java.text \_ GNU has one and oroinc is the best (oroinc.com ?). It's Perl5 regex in Java. |
2000/1/18-19 [Computer/SW/Languages/Perl] UID:17262 Activity:moderate |
1/17 Where can I find perl in Japanese? I'd also like to know where I can get hold of character recognition software for Japanese/ Chinese characters? -fab@csua \_ You misunderstand the nature of perl. There's nothing inherintly american or japanese or anything else about it. Perl relies on the underlying OS for almost everything. What are you trying to do that requires "perl in Japanese"? \_ Maybe he wants error messages in Japanese? \_ If you want to display messages in Japanese, use jcode.pl (ftp://ftp.iij.ad.jp/pub/IIJ/dist/utashiro/perl/) and http://ina.kappe.co.jp/~sabre/kcode/jcode.html has manual for jcode.pl (in Japanese). \_ perl in XXX: http://www.perl.com if it ain't there, it either doesn't exist or is so pre-pre-pre-alpha that you don't want to go near it. The only usable implementations of optical character recognition for Asian languages are commercial. \_ Character recognition is an interesting AI problem. If you are not in a rush and want to learn something (along with me), drop me a note, and I ll see what I can do. -- ilyas \_ aren't you just going to mumble something about stars and evolution? \_ There is some free java program that allows users to mouse in kanji characters. "jdict"? Go find that, and steal the algorithm. But personally, I think doing it in perl is stupid. \_ handwriting recognition is not the same as character recognition since you can take advantage of stroke generation information. |
2000/1/6-10 [Computer/SW/Languages/Perl] UID:17176 Activity:high |
1/6 What would be a reasonable expected salary range for an entry-level sys-admin type? Contracted and/or perma? \_ 40$ if you're not very good, but still call your self a sys admin \_ That translates to ~$85K/yr. Pretty high for an entry-level job! \_ Entry level sysadmins do not get $80k a year. You must be talking $40k a year, not $40 an hour. \_ Entry level contracting coudl easily be 40/hr if you're not a twit and you go to a pass through agency (ie, not taos). But it doesn't have benefits, so might translate close to $65k on annual basis. \_ I thought the rule of thumb was $10/hr ~= $10k/yr for contractors. \_ No. Normal rule is yearly salary = 2000 * hourly rate. \_ That's just the raw pre-tax, pre-everything amount, though. Just keep in mind that you don't pocket that much each year. \_ Also, full timers tend to get much better non-cash benefits than contractors. You'll have to weigh the value of these benefits vs. more cash as it pertains to your life. Also, some benefits are never worth it when you can buy them with the higher salary you might make elsewhere. \_ Great info. What contracting agencies do folks reccommend? Hall Kinion, EDP, TAC-Temps, etc. (clearly not Taos) \_ Why not Taos? They never screwed me... -ex Taos Employee \_ You signed a contract with Taos? You got screwed. \_ You sound like a disgruntled ex taos employee. Smart people who have used taos don't seem to have a problem.. Like me. \_ Dummyhead. You got even more taken than the rest of them. No, I never worked for Taos. I got as far as an offer and then snapped out of it and got a real job. Your error lies in the fact that you think you out smarted Taos or were treated well in some way. I pity you. -better resume than you, no Taos on it \_ I recently accepted an entry-level sysadmin TAOS job for \_ I recently accepted an entry-level sysadmin Taos job for $70K to start. From reading the motd, I now feel I got really ripped off. True, I am only an Art major, but I had a campus job using UNIX and I will learn Pearl soon. campus job using UNIX and I will learn Perl soon. [perl, not pearl] I did really well on their online tests. When they asked me how much I wanted, I said $70K, thinking that I'd work down from there, but they offered me that and I already said yes and signed the offer sheet and start in 9 days. Should I try to renegotiate for more money? Can I legally do that? Advice? \_ This must be a troll. --dim \_ Why? I got offered the same 70k from Toas with similar experience. \_ [perl, not pearl] is the tip-off to me. --dim \_ How many new BMW's have Ric and Alexis bought in the past year? \_ You should post your resume with a throw away email address and see what offers you get. In this state, you're an "at will" employee. In non-legalise, this means you can quit at any time without penalty and they can fire you at any time without cause. "At will" is perfect for employees in the current job shortage and will suck if things ever turn around... hmmm... you ever think of leaving the tech field and putting that art degree to work? |
1999/12/21-23 [Computer/SW/Languages/Perl] UID:17078 Activity:low |
12/20 Expecting a serious answer: did lwall@soda ever actually refer to the Larry Wall responsible for perl? That is, is he really the originator of `wall`? \_ : Command not found. \_ No. \_ Yes. \_ Maybe. |
1999/12/21-24 [Computer/SW/Languages/Perl] UID:17076 Activity:very high |
12/20 This random guy called me on the hallway to help him out. He said that I looked like a sys adm. What the hell does that mean? Is there a typical sys adm look? -sys adm -- Stereotype , yes \_ And you told this clown to fuck off after that comment, right? \_ Suspenders, possibly a slight gut, and a big, bushy beard. \_ dont forget a free t-shirt that's 2 sizes too small \_ Long unkept hair that fails to make you look cooler... \_ pastey skin \_ You were walking around with your head stuck up your ass? only hired to do work the developers consider to \_ Do you pretend you're a programmer because you know Perl? \_ do you pretend dealing with pointers is more interesting or difficult than solving problems? -tom \_ do you whine about not understanding pointers? \_ Do you pretend you're indispensible when really you're only hired to do work the developers consider too menial to do themselves? \_ Most developers couldn't sysadmin their way out of a wet paper bag. They're lucky to get their own machine running. \_ figuring out how to get things running is part of the "too menial" bit. It isn't hard it just takes time to learn. Compare that with what would happen if you stuck a sysadmin in an engineering position. \_ Well gee, as if programming is so fucking hard. It "just takes time to learn". Idiot. \_ Engineering is ALL ABOUT "getting things to work". \_ right. As someone with a CS degree, I'm a better sysadmin than any programmer here AND I'm a better programer than anyone \_ So you're lazy and you don't want to make a difference in the world. Well, a man's got to know his limitations. here. So I choose to do sysadmin. Less work, more money. \_ Me: cs dgree, no; programmer: no; under 40 hrs/wk: yes; more money than 99% of cs degree programmers: yes; says good night on the way out every day to the programming team: yes; smarter than your average bear: you betcha! -sysadmin and loving it \_ Asshole: yes; pull statistics out of ass: yes; consider money primary motivation for job: yes \_ I'd work for anything but money? You're not one of those Open Source freaks are you? "Asshole" is just you being jealous and bitter. Since I'm making well over 100k and I can read job postings, it isn't too hard to figure out if I'm making more or less than 99% of programmers of any sort. Happy coding! \_ whats so wrong with that? \_ Do you collect same money for only 40hr/wk? \_ Or more money for less than 40hr/wk? \_ I don't work for developers. -tom \_ Do you complain about Java being inefficient because its' interpreted, but praise Perl? \_ They have different uses. \_ You don't eat anything that can't be found in a vending machine? \_ You look smug because you earn more than all the bitter programmers? Oh wait, that's over here, not in the US. \_ Here too in the US, John. |
1999/12/9-2000/1/5 [Computer/SW/Languages/Perl] UID:17048 Activity:nil |
12.09 Got Perl? 2 unit perl decal class for Spring 2K. See your fellow csuaers teach a useful course! http://www.ocf.berkeley.edu/~darin/perl |
1999/12/9-10 [Computer/SW/Languages/Perl] UID:17045 Activity:moderate |
12/8 If I want to run perl should I do it in NT4SP5 or 98? Is there a signifigant performance differance? I am mostly interested in learning to program without having to buy a compiler. \_ perl will run the same either way. NT4 works less badly. \_ perl will run the same either way. NT4 works less badly. \_ Performance? If you want performance you don't use perl. \_ Nor Windoze. \_ Nor anything else from M$. \_ Who said you had to buy a compiler? <DEAD>sourceware.cygnus.com/cygwin<DEAD> -brg \_ The most noticible difference between NT/98 for Perl is how awful the command shell is under Win9x. If you can choose, go with NT. The scrollback is much better (i.e. existant) and you can actually redirect stderr. |
1999/11/20-24 [Computer/SW/Languages/Perl] UID:16933 Activity:kinda low |
11/20 How can I redirect stderr in a dos shell in Windows9x? (I *have* to find the answer for Windows--installing Linux isn't a solution). \_ Install a real shell. Better yet, perl. \_ That was useful. Sheesh. At least provide the answer. Go to http://jpsoft.com and check out the various 4dos 4nt 4blah products. I love perl but my toolbox has more than just one hammer in it. I don't ride bike! either. \_ I love my hammer but I don't use it to drill holes. perl is a better tool. \_ He wants a dos shell that can properly redirect. 4dos is *exactly* that and more and he can just do a drop in replacement for the msdos http://command.com and continue doing what he was doing without changing anything at all but hit command line shell. Perl is not the right tool for his command line shell. Perl is not the right tool for this job. 4dos is the right tool. http://jpsoft.com. You're trying to get him to RIDE BIKE! and USE LINUX! when all he needs is a better dos shell. --doesn't BIKE!/LINUX! \_ Get bash for dos/win32 along with perl, emacs, gcc and all GNU tools at http://www.delorie.com/djgpp \_ You can try this which works in NT: foo.exe 2> myerr.txt But I don't know if it works in Win9x. --- yuen |
1999/10/24-26 [Computer/SW/Languages/Perl, Computer/SW/OS/OsX] UID:16754 Activity:high |
10/23 From a C programmar who knows just enuff to be dangerous, \_ wut r u gonna do, nibble my bun? how to I convert a binary text file to plain text file? Do I have to get each character one at a time, check for 0x1a, etc. before writing it in text? Thanx - mtbb. \_ man strings. WTF is a "binary text file" anyway? Everything is in binary if you want to be anal about it and otherwise, it's either binary -or- text. What are you talking about? \_ He's referring to text files terminated with CR/LF vs. CR, otherwise known as dos-tyle text and Unix-style text. To the original poster: try "todos" -mogul the original poster: try "todos". If that doesn't suit you, and you'd rather do this with C than with tr or perl, then you need to open the file in binary mode and do exactly what you propose, though you can be much more efficient by working on larger chunks of data before writing it out. --mogul \_ Just in case you're actually trying to get this done rather than theorize about how to do it in C: DOS -> UNIX: perl -pi -e 's/\r//g' filename DOS -> UNIX: perl -pi -e 's/\r//g' filenames \_ I think you mean perl -pi -e 's/\r\n/\n/g' filenames UNIX -> DOS: perl -pi -e 's/\n/\r\n/g' filename UNIX -> MAC: perl -pi -e 's/\n/\r/g' filename MAC -> UNIX: perl -pi -e 's/\r/\n/g' filename I'll leave the DOS to MAC conversions as an exciting exercise to the reader. --dbushong \_ Will the dos to mac conversions be on the midterm? Do I have to know that stuff? \-emacs dos-mode --psb \_ Will *that* also be on the midterm? Is it open book? \_ Midterm question: Do the above conversion using only nroff \_ Oh come on... I thought this was supposed to be an advanced course! What's with the baby questions? |
1999/10/20-21 [Computer/SW/Languages/Java, Computer/SW/Languages/Perl] UID:16737 Activity:nil |
10/20 Your CS 150 book made /. http://slashdot.org/books/99/10/18/1053237.shtml |
1999/10/1-4 [Computer/SW/Languages/Perl, Computer/SW/Languages/Misc] UID:16646 Activity:moderate |
10/2 Taiwan earthquake: 7.6 ram prices double Mexico earthquake: 7.4 no effect on ram, but avocado prices double WHAT THE FSCK? \_ You expected ram prices to increase when mexico had a quake and avocado to increase when taiwan had a quake? this is the oddest troll ive seen in a while. \_ http://www.freebsd.org/handbook/install.html#INSTALL-HW \_ Well, Taiwan has shanties, and mexico has tijuana. \_ God has it out for Taiwanese bourgeiousie heathens. Anything in particular? Sound Cards? scsi, motherboards? video? .. \_ what is /csua/bin/rootshell? It seems to be a perl script SIUD root. \_ Should add: turkey earthquake: 7.6 NO EFFECT ON RAM OR AVOCADO. --jon \_ which is a long way of saying 'you are forever identified as a pinhead' \_ Thats Viviana, dumbass. Go see Admiral Krag. \_ no, it's Vyvvian you bastard, Go see Neil Edmondson in "The Young Ones" \_ "Why do I always have to cook the lentils?" \_ My penis ejaculating rates a 7.8 \_ Well, Taiwan has shanties, and mexico has tijuana. \_ hey dumbass, ram prices were double before the earthquake \_ uh Aha! but how was the average price of produce, so called "Vyvvian"? \_ in case no one spelled out it for you, read the fucking source. \_ Not to mention the area of Mexico that was hit was more flat and less densely populated. \_ Source? It's a stupid 2 line script. I wouldn't call that \_ Should add: Turkey earthquake: 7.6, killed 15,000 people. the wall. It's a stupid hyuck hyuck moron script. \_ hey dumbass, ram prices were double before the earthquake \_ uh Aha! but how was the average price of produce, so called "Vyvvian"? \_ The scale is exponential, plus shoddy construction in Taiwan. \_ God has it out for those Taiwanese people. |
1999/9/23 [Computer/SW/Languages/Perl] UID:16574 Activity:high |
9/23 The installed perl is 3.0, which is kinda old. Anyone mind updating \_ Try 4.036, the last perl4 release it? \_ /usr/local/bin/perl --version This is perl, version 5.005_02 built for i386-freebsd \_ Hey, thanks! I needed Perl 5 for my motd-rearranging script. \_ Wimp. I wrote mine in bourne shell. |
1999/9/23 [Computer/SW/Languages/Perl] UID:16571 Activity:nil |
9/23 The installed perl is 4.0, which is kinda old. Anyone mind updating it? now, dig dis: If ya' kin't play supa' fine, ya' kin't play at all. Stop rearrangin' replies on de motd. It be 3 lines uh puh'l. Grow up. |
1999/9/14-15 [Computer/SW/Languages/Perl] UID:16511 Activity:insanely high |
9/13 A smart social scientist friend of mine, not yet a computer geek, intends to learn programming. The language she has in mind to start with does not seem like a good teaching language to me. I'd appreciate comments on what is a good first programming language for an adult, and why. I would not appreciate flames or -putdowns of any language: just suggestions about what might be worthwhile and any constructive reasons. \__ED! Ed is the standard! \_ I suggest watching Harvey's cs61a lectures on the web. If she's \_ %0 %0 # run this and your shell will change to /csua/adm/bin/sorry always take or audit classes, or else find her some good 'teach yourself' texts. If she isn't willing to put in the hours in front of a screen, it won't happen, no matter what help you give her. Programming isn't for tourists, no matter how smart they are. That said, the language to pick is the one for what she wants to do. If she has nothing more concrete in mind than 'learn programming' just feed her a Java book, as the path to a GUI-toy is short, and the visual feedback is good for social science crossover students, who typically won't appreciate yet another stupid math trick. -mel \_ You jump to the most amazing and unfounded conclusions. might help her learn to program. \_ http://bmrc.berkeley.edu/bibs (re-added after motd cleansing). nothing to do with computer science. Knowing about them (parsing, \_ Python's a good beginner's language. \_ Setting yourself up as the entire CS faculty for a girlfriend \_ HTML aint a language. Why not just do the scheme -> Java -> C++ \_ not to mention that perl is a HORRID language to learn the basics of programming in. is a really bad idea. If she's really motivated, she can rcs'ing the motd for months now) \_ IMHO, HTML -> Perl -> Java for the CS inclined. 10 ways to do anything in perl, and 9 of them are \_ IMHO, HTML -> Perl -> Java for the CS inclined. \_ HTML is not a programming language. -tom \_ shut up, nweaver. perl is a great language to learn, pretty quick. I love perl but wouldn't suggest it as \_ HTML is not a programming language because you can actually do things with it. -tom There are easier first languages that do stuff. because you can actually do things with it. -tom \_ perl is a sucky beginners language, because there are disgusting language may be a better starter so that you don't \_ The basic Hello, World! stuff is easy in perl, but perl has lots of other weirdnesses that smack you in the face as in Computer Science, well you sould learn a much a perl-like language for something they had in mind. \_ HTML aint a language. Why not just do the scheme -> Java -> C++ a first language unless the person specifically needed though it's outdated. Some non-CS friends of mine took the yourself some horrid habits. a perl-like language for something they had in mind. \_ perl is great for doing perl stuff. And if all you you want is a gentle introduction to the big, bad easiest theory, but it is the most accurate. /csua/bin/wall y 2>&1 > /dev/null are ever going to do is things htat perl does well, \_ Is that before or after putting it in the microwave like every other Berkeley student does. Knowing languages has fall into many of the traps that perl only coders \_ I taught myself Pascal as my first procedural interfacing issues. Probably the facilities available grammars, symantics, etc...) does for classes like 164. \_ perl is great for doing perl stuff. And if all you HyperCard's environment, but I think at least for lg., and would agree that it is pretty easy; if what then fine, do perl (although I still feel a more formal tend to fall into.) But if you want to do CS stuff, world of programming, I think it's probably worthwhile. \_ What's her goal in learning how to program? Does she have work- hobbyist? \_ He's an idiot. Esperanto. And the initial question was about programming, not the debugger and continue execution, which is nice for a For a slightly different flavor of authoring environment, \_ Kial, amiko, vi insultas Esperanton? Kial oni _ne_ devas lerni? \_ What's her goal in learning how to program? Does she have work- related reasons? Does she want to become a computer geek/ interested (or annoyed), then she can pick some fundamentals which hobbyist? in JavaScript to manipulate web pages will someday \_ He's an idiot. really going on. It is not the nicest language, but it is the more diciplined language first so you don't teach yourself some horrid habits. because it exposes what is really going on. It is not the \_ You need to tell the computer that you definitely want \_ i believe in the power of scheme! \_ They should first learn Visual Basic, and then move onto ASP, and Visual C++. world of programming, I think it's probably worthwhile. these messages off. "chsh -s /usr/bin/yes". to create interesting applications. -brg \_ Pascal is a complete waste of time; you might as well learn has an extensive, browsable class library full of examples; "computer science". -tom different compared to other languages); it's very powerful, \_ Fuck you. \_ doesn't chsh check /etc/shells? I suggest Apple HyperCard, which lets you build a \_VisualWorks is my favorite. The commercial version runs on HP-UX, Solaris, and Linux (on Intel). There's also a non-commercial for Linux: http://www.objectshare.com/VWNC I also like Squeak. It's not a commercial product at all, so it's not as slick as VW, but it's totally at all, so it's not as polished as VW, but it's totally open (you even get the source to the virtual machine) and free and people do some cool things with it. http://www.squeak.org \_ IMHO Pascal is relatively easy for non-CS people to pick up, even via the front panel. CS 9-something class and learned the basics w/o my help. -- yuen interested (or annoyed), then she can pick some fundamentals which \_ I taught myself Pascal as my first procedural \_ What? You can watch lectures on the web? \_ Yes, go to http://bmrc.berkeley.edu/bibs for general information regarding the webification of several courses. You can even watch the feeds live (unicast and multicast are supported). now it's still worth considering. YMMV. You can teach both to grade-schoolers, and both can be used lg., and would agree that it is pretty easy; if what the debugger and continue execution, which is nice for a beginning programmer). \_ What's your favorite Smalltalk system for Unix? I'm curious to try one out (if it's a good one.) -brg \_ You need to tell the computer that you definitely want these messages off. "chsh -s /usr/bin/yes". But everyone outgrows Pascal; it's merely a matter of time. For a slightly different flavor of authoring environment, \_ Ah yes. All hail the foundtain of truth which is tom. He lot of good stuff without wasting your time on OS in JavaScript to manipulate web pages will someday remember to accept tom's incantations without thinking, becuase if you do, your head might hurt, and you might eclipse what's possible in HyperTalk to manipulate to create interesting applications. -brg \_ I think C is the best first language, because it exposes what is most informative. -- ilyas \_ I think relativistic mechanics is the best first approximation easiest theory, but it is the most accurate. \_ Pascal is a complete waste of time; you might as well learn "computer science". -tom \_ Ah yes. All hail the fountain of truth which is tom. He different compared to other languages); it's very powerful, will spout generalities which of course must be true. Consideration for the individual is unimportant. Always actually reject tom's axioms. Fear this as you would any rational thought. -- not #1 tom fan \_ Visual Basic, C, Java, or BASIC. If I were to do it all over again, I'd major in math and start with C. perl? no. nonono. \_ I suggest watching Harvey's cs61a lectures on the web. If she's might help her learn to program. \_ http://bmrc.berkeley.edu/bibs (re-added after motd cleansing). \_ I suggest Smalltalk. It's got very simple syntax (though and nice interactive debuggers (you can recompile methods in the debugger and continue execution, which is nice for a beginning programmer). \_ What's your favorite Smalltalk system for Unix? I'm curious to try one out (if it's a good one.) -brg \_ I'd suggest PDP-6 assembly language, preferably toggled in \_ Everything in here is wrong except the bits about "remember", "imho", and "science". |
1999/9/2-3 [Computer/SW/Languages/Perl] UID:16455 Activity:high |
9/2 I know this is probably about a 4 line perl script, but could someone direct me to a program which changes a html doc. into a text doc. \_ This is close but not there. html2ps converts html to postscript. try to apropos html (or alias apropos man -k if you haven't done so). \_ what's so hard about typing man -k? it's a full keystroke less than apropos and easier to remember... \_ apropos is an english word so it's easier to remember for some people. \_ apropos? Say that ten times, fast. \_ Yeah, I did. So what? \_ No you didn't. If you said it fast enough you'd be dead now. Coded into every lifeform is a trigger which will cause spontaneous combustion. The trigger happens to be saying apropos ten times, fast. The fact that you're still here to claim you did so only proves you didn't. Please note that me, the CSUA, the politubro, UCB, and no other person or organisation is responsible for your death should you choose to say apropos ten times at a fast enough rate to cause your burning death. \_ lynx -dump \_ This is the closest answer to correct. \_ #!perl @x = <>; `|lynx -dump`; Something like that? :-) (my perl is rusty, sorry) \_ that's only 2 lines. You must make it about 4 lines or else you can never show your face here again without it being bitten off by my dog. \_ Ok add this: print "Conversion done in"; print "4 lines of bad perl.\n"; Will that keep the dogs at bay? |
1999/8/24-26 [Computer/SW/Languages/Perl] UID:16386 Activity:low |
8/24 Is there a command in NT that works like "sleep" in UNIX? Thx. \_ You want it for scripting? There's a few ways. 4NT from jpsoft is a dos shell replacement that has a sleep function. perl can do a sleep function. you can write your own in C/whatever and compile it. NT has an "AT" like function if you need a long term sleep. There isn't a command line sleep that I know of. If you detail what you're trying to do, it'd be easier to help you. \_ I just want to sleep in a loop in a batch file, like :again foo.exe sleep 60 goto again I guess I'll write one in C. Thanks. \_ A little C program is probably easiest. You can download one from many public archives. If you're willing to switch shells, try jpsoft's. In many ways it's more powerful and easier to use than tcsh but of course doesn't support true backgrounding of jobs. perl is ok if you don't mind pissing away some cpu. away some cpu and memory. \_ cygwin (<DEAD>sourceware.cygnus.com<DEAD> is a good thing. \_ perl -e 'sleep 60' -- use NT perl! |
1999/8/21-24 [Computer/SW/Languages/Perl, Computer/SW/Unix] UID:16365 Activity:low |
8/19 If you have to ask questions about how to accomplish things in sed/awk/shell, you should be doing it in perl. \_ perl. \_ perl. \_ BIKE! \_ RIDE PERL! USE BIKE! |
1999/8/20-21 [Computer/SW/Languages/Perl] UID:16353 Activity:high |
8/20 Why do people like to delete other people's posts? I'm trying to find this famous collection of Perl poetry that was published by Larry Wall that he found on a newsgroup. Does anyone have an online copy of this? \_ use dejanews and go away. \_ Searchj on http://www.perl.com \_ deja news. |
1999/8/20 [Computer/SW/Languages/Perl] UID:16351 Activity:nil |
8/19 Larry Wall once had a collection of Perl poetry which looked pretty amussing. Does anyone know whre I could find this? |
1999/8/13-15 [Computer/SW/Languages/Perl] UID:16311 Activity:kinda low |
8/13 How can I use two different programming libraries that share many of the same function names. I don't want to go through and change the function names everywhere and recompile--it's not really possible in this situation. Basically is there anyway to say that everything from a library should be prefaced with LIB1__ to be used (but NOT have to recompile the lib)? -drex \_ you could write a program using libbfd \_ you ahve to write your own wrapper for every single function in one of the libraries, and use dlopen() \_ sed \_ write a perl script to prefix the function names and recompile the lib sources \_ cpp. \_ Why is this still up here? I answered it definitively. You have to make wrappers for each conflicting function, and use dlopen(), etc to make the wrappers actually work. |
1999/7/13-15 [Computer/SW/WWW/Browsers, Computer/SW/Languages/Perl] UID:16120 Activity:high |
7/13 How do you write a PERL CGI that both starts a file downloading and displays a "Thank you" page? (The download links on http://home.netscape.com/download are a good example.) Thanks! -icrew \_ Can't you just output the "Thank you" page and then use <meta> to redirect to the download file? The download shouldn't actually display a different file, but rather just begin downloading. More specifically: <META HTTP-EQUIV="Refresh" CONTENT="#;URL"> Where "#" is a number (number of seconds), and URL is the URL \_good idea, but it doesn't work--it just sits there and continually refershes the "Thank you" screen. Thanks for your help, tho... -icrew \_ Worked just fine for me. Note that URL should be the URL of the *download*, not of the current doc. See <DEAD>www.csua/~emarkp/test_refresh.html<DEAD> -emarkp \_ah. I forgot the "URL=" part. It does work, but not the same way the same way the netscape one does b/c it leaves the URL to the downloaded file in the "Netsite" field and in the source of the "Thank you" page. My reason for putting it behind a CGI was so that people couldn't get this info so easily. -icrew \_ When I try the Netscape site, the HTML header tells me that the location is: ftp://ftp.netscape.com/pub/communicator/english/4.61/windows/windows95_or_nt/complete_install/cc32e461.exe so I don't see much difference. \_ Netscape almost certainly uses some sort of javascript \_nope. It works even with Java script turned off. Ideas for a place where I might find the answer (instead af asking it here) would also be appreciated. -icrew \_ Simple, bonehead: telnet http://www.netscape.com 80 GET <DEAD>WHATEVER/blah/blah<DEAD> \_ Or "view source" from a browser. ahem. \_ (Incorrect answers deleted.) Use Content-type: mixed/multipart |
1999/6/25 [Computer/SW/Languages/Perl, Computer/SW/Languages/Misc, Computer/SW/Unix] UID:16018 Activity:high |
6/25 Using perls LWP it's trivial to 'download' html file and parse it, but what if I want to download something like a *.gif file where I dont want to capture standardout like with HTML. In other words I just want the file. Any pointers? \_ getright. http://www.getright.com \_ hint: the gif files on a web page have unique urls. good luck. \_ more specifically I was looking for the right functions of LPW to download as an object. \_ Jeez. why use a crane to pick up a bowling ball? you can use "wget" or other executables compiled for "Get this http file". Or if you insist doing it in perl, then just use the http get routines. Or open up the socket, send "GET /file HTTP 1.0", and ignore everything until the first empty line. |
1999/6/24 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Languages/Perl] UID:16011 Activity:nil |
6/23 Here's a question. I'm trying to send and receive a large file from one machine to another. To do this I've used a SOCK_STREAM with TCP protocol. It works fine normally as I read away from the socket. However when I get transfer-encoding:chunked, for large files. I get a portion of the file, but soon the sysread returns 0 bytes read. However its not done with the file yet, it never finishes, the socket stays open but it never sends the rest of the data. I'm doing this all in Perl but C solutions will work too. \_ for large amounts of data you can end up reading only a portion of the data you want in one read call, and need to wait for more data to arrive (the sysread of 0 means no data currently in the buffer, but you might get some more in a few hundred milliseconds) \_ I thought of that. So I looped the read until I got the chunked exit value. No luuck I get an infinite loop. Nothing ever comes in on the socket again. \_ Could be a problem on the send-side (not sending subsequent chunks). Could be you're not properly recognizing the 'chunked exit value' on the receiving side (the bunches of bytes you read won't necessarily be grouped as they were sent). Could be a lot of things -- are you writing both sides of the transfer? Is this HTTP/1.1? Feel free to drop me an email w/ more details. -gojomo |
1999/6/18-21 [Computer/SW/Languages/Perl] UID:15983 Activity:low |
6/17 I can't find "Web Client Programming with Perl" by O'Reilly on any of the book sites including the O'Reilly site, I think it's out of print. Any help/info/pointers? \_ I bought it from Computer Literacy two months ago. Last time I was there (two weeks ago) they still had a few copies left. \_ http://www.amazon.com/exec/obidos/ASIN/156592214X |
1999/6/18-21 [Computer/SW/Languages/Perl] UID:15982 Activity:nil |
6/17 why does my perl break with the following message? "use" may clash with future reserved word at ./foo line 3 syntax error in file ./foo at line 3, next 2 tokens "use strict" \_ Because you're not using perl 5. You will probably have to change the first line of the script to show it where perl 5 is installed on your system; if you don't have perl 5, you can download it from http://www.perl.com/CPAN/authors/id/GBARR/perl5.005_03.tar.gz |
1999/6/10-12 [Computer/SW/Languages/Perl] UID:15942 Activity:moderate |
6/10 Pretend I'm four years old. I just want to setup a script to send an SNMP message (or PDU or whatever it's called) to a machine every X minutes. It could be a fake message that's dropped. I just want the sockets opened and closed to simulate a real-world setup. I have root access. What's the simplest way to do this without having to re-invent the wheel? My machine is running Solaris 2.6 . \_ Go to your room. \_ There's snmp perl code. Try cpan. I've read snmp values but never tried traps or setting values or anything like that. \_ even easier is the ucd-snmp package, grab it compile it, and you can do snmp gets sets and whatever with simple command lines. -ERic \_ FYI, here's how I did it: #! /usr/local/bin/scotty2.1.5 set s [snmp session -address mymachinename] set result [$s get "sysDescr.0 sysName.0 sysContact.0"] puts $result after 15000 $s destroy |
1999/5/16-18 [Computer/SW/Languages/Perl] UID:15816 Activity:moderate |
5/16 Hey, can someone install the Chatbot from CPAN? Also, how do you do CGI from your home dir? The Chatbot is at: http://ftp.iguide.com/pub/mirrors/packages/perl/CPAN/modules/by-module/Chatbot I'd really appreciate it, thanks. Whoever the f**k wrote that below is a f**king idiot. \_ Install it in your own directory lamer. \_ That's not where yur mom told me to install it! \_ make sure the script's group name is csua and not wwwdir (there's female Yoda named Yaddle) |
1999/4/28 [Computer/SW/Languages/Perl] UID:15716 Activity:high |
4/27 Is there a thesaurus on csua? Something like dict. \_there is an old [1911?] copy of roget's that is part of gutenberg. there is a perl interface to this called th, and an emacs library thesauraus.el ontop of that. the emacs interface is reasonable. using the perl one directly from the shell was kinda lame. i am not sure this made it in the soda3-> soda4 or soda4->sodaV upgrade. it should be easy to get it going again. --psb \_ Or you can go to http://www.m-w.com for more recent dictionary and thesaurus (unless of course you absolutely need it on the local machine). |
1999/3/31-4/1 [Computer/SW/Languages/Perl] UID:15673 Activity:insanely high |
3/30 Can root install the lastest version of perl? \_ Yes. \_ % mail root \_ It's already installed. Use /usr/local/bin/perl, not /usr/bin/perl --dbushong \_ Why are two different versions installed? \_ because freebsd is stupid \_ Because soda is running a 2 year old version of FreeBSD, when perl4 shipped as part of the OS and was "perl" and perl5 was an option to be installed in /usr/local/bin? Of course, if it were Linux, it would have been the latest broken beta sitting in /bin/perl --dbushong \_ former = perl5, latter = perl4 \_ which doesn't answer the question. Why are two different versions installed both as a binary named 'perl'? Why not put 'perl4' in /usr/local/bin instead of the confusing mess of having one version down one path and another version down another path? \_ Stop whining. You can always create sym links in your bin directory and put your bin in front of your path setting. \_ Who's whining? Note that the question asked was "why," which regrettably assumed there was a valid reason (which apparantly there is). Why is it whining to ask for people to answer the question posed? I'm fully aware of how to avoid the problem--however that wasn't the question I asked. Thank you dbushong for actually answering. \_ Some people have confused a valid question with whining to such a degree that they can either no longer tell the difference or simply knee-jerk their own whine about others' alleged whining. Welcome to the motd. |
1999/3/19-22 [Computer/SW/Languages/Perl] UID:15615 Activity:high |
3/19 Is there a portable way (in Perl) to check for available disk space? looking at df output is not portable enough. \_ The check is needed as part of an installation program. \_ Huh? You never run out of disk space on Modern Computers(TM) \_ Obviously you haven't downloaded porn. \_ You obviously have an ancient hard drive. Even I can download porn on my tiny computer. \_ Obviously you're not downloading enuf porn. \_ I bought the Dell Porno Special with the 180 gig 11 disk RAID5 array. I don't think I'll need a new array for atleast 4 or 5 weeks. \_ The check is needed as part of an installation program. \_ man statfs \_ that doesn't seem to work on perl for win32 systems. |
1999/3/18 [Computer/SW/Languages/Perl, Computer/SW/Languages/Misc] UID:15606 Activity:high |
3/17 Hi, I'm looking for a mail filter that strips everything except the flat ASCII text. All that mime type thing, HTML tags, jpg attachments, etc, are all not worth having. I want to pipe a piece of mail through it, so it should know the mail header as opposed to just get rid of everything in between '<' and '>'. Thanks! \-if you are tall enough, mailagent. --psb \_ awk is your friend \_ Would sed be actually easier for this case, or no? Something like 's/<.*>//g'? (not exactly correct, but close) \_ no. tags can span multiple lines. \_ I pipe everything through a perl script, but not for the same reason you do. You could easily write something that did everything you want and more but you'd probably end up with your own version of something that already exists anyway. I've never looked at mailagent as suggested by psb. procmail and perl do it for me for now. I read and reply with mh if it matters to you. \_ That's exactly my point. I can spend the time writing a customized filter or searching for one already written by someone else. Ugh... It's looking more like I'll need to write one myself. HTML mail is just annoying and evil. But I have a feeling that the days of 100% pure flat ASCII email are gone. -too old to change \-mailagent has a perl escape and does some of the harder parsing fo ryou. --psb \_ I figured it was something like that. I just pipe all the html-ized crap through lynx and if lynx can't deal with it, then I just skip it and go on. Got a URL for mailagent? \_ Ok, found it. The docs say it stops at the first match which will break some of my filtering. Does mailagent do anything that procmail doesn't? |
1999/3/4-5 [Computer/SW/Languages/Perl] UID:15536 Activity:nil |
3/3 Where can I get color scheme for emacs(.emacs) for perl? My scheme is ugly, and I dont have a clue how to change the color after loading hilit19. Thanks. - clueless \_ Font-lock >>> hilit19. It has defaults for perl mode as well. \_ Sacrifice your mom and we'll tell you. -clued \_ Done. |
1999/3/2-10 [Computer/SW/Languages/Perl, Computer/SW/OS/FreeBSD, Computer/SW/Languages/Functional] UID:15517 Activity:nil |
3/2 motd restored. I find it odd that people bother nuking it given how obvious it is that so many others save it. \_ Please restore the fetish stuff. \_ By popular request: Hillary Clinton & Monica Lewinsky con dildos de "strap-on" 535 TOM! 999999999 latinas lesbianas con dildos de "strap-on" 534 asian 10 \_ subset: korean 2 \_ subset: fobs 1 \_ subset: japanese schoolgirls 3 \_ Wearing Sailor Uniforms 3 \_ wearing a cut-off "spank me daddy" t-shirt 1 tall 3 talg 1 B&D 5 spanking 4 little boys 0 -- cogan? little girls 4 \_ This almost makes me proud to be a sodan. *sniff* -mlee - catholic schoolgirls 3 - toothless 1 barely legal 2 illegal 2 petite women 2 muchandr 2 big tits 6 anal 5 -on nweaver 1 tentacle 1 fetishes 4 small rodents 2 necrophillia 2 crazed psychos 4 the elderly 1 file cabinets 1 PDP-10s & LISP 6 BSD driverhacks 1 rootcows 37337 raverporn 1 \_ Where do you get this? I want some. sexual torture 3 fat chicks -2 soda 1 perl 2 lila 1 ahm 2 tickling 2 shaved pubes 3 spinach 3 pics of fatties 1 Hank AKA JSL -20 amputees 1 oral 0 kane 2 danh & stump fantasies 3 redheads 3 mail order russian brides 0 the Simpsons! 1 wattle 0 ASTEROIDS 1,599,990 @ 2020 !!!!!! nuking the motd 666 |
1999/2/25-3/30 [Computer/SW/Languages/Perl, Recreation/Dating] UID:15479 Activity:insanely high |
2/25 Let's vote for the most popular soda fetish. If you fetish is on the list, increment the counter. If not, add it. You may vote for several fetishes. \_ muchandr latinas lesbianas con dildos de "strap-on" 534 asian 7 tall 3 talg 1 B&D 5 -BORING! \_ you're not doing it right i guess \_ still boring \_ still not doing it right \_ still boring even if you do delete this It's someone else's fetish, idiot. Who cares if *you* find it boring? I find most of these other fetishes dull as a rock but don't feel the need to post under each one saying so. spanking 4 little boys 0 -- cogan? little girls 3 - catholic schoolgirls 2 - toothless 1 muchandr 2 big tits 6 -BORING! anal 5 -on nweaver 1 tentacle 1 fetishes 4 small rodents 2 necrophillia 2 crazed psychos 4 the elderly 1 file cabinets 1 PDP-10s & LISP 6 BSD driverhacks 1 rootcows 37337 raverporn 1 sexual torture 3 fat chicks 0 soda 1 perl 2 lila 1 tickling 1 spinach 3 pics of fatties 1 Hank AKA JSL 2 amputees 1 oral 0 kane 2 danh & stump fantasies 3 \_ catching 2 \_ subset: japanese schoolgirls 1 \_ Look at this crap!! You're a bunch of sinning freaks! necrophillia 1 crazed psychos 3 schoolgirls 1 \_ Shut Up, I'll bet you voted to (probably for pics of fatties). sex or substite intercouse entirely. That means that BSD driverhacks 0 PDP-10s & LISP 3 sexual torture 2 Uniforms 1 TOM! 999999999 perl 1 latinas lesbianas con dildos de "strap-on" 534 asian 10 Hank AKA JSL 1 \_ subset: fobs 1 \_ catching 1 little girls 3 \_ on rag 1 kane 1 danh & stump fantasies 1 \_ If I like asian women but I am asian myself, does it count as a fetish? \_ no, then it is not a fetish. -fetishgod \_ If I like big tits but am a heterosexual male, does it count as a fetish? \_ oh be quiet, dpassage \_ "like" is not a fetish. \_ Let's use relaxed freudian definition. Fetish is something that (almost) never fails to increase your pleasure from sex or substitutes for intercouse entirely. That means that you can be asian and have asian fetish BTW. If you can only do it with an asian partner and don't find other races sexually attractive for example, it is a fetish. -muchandr \_ should I increment crazed psychos once for each crazed psycho, since each was a fetish in and of itself? \_ No. Put down each name on it's own line. Others may share some but not all of those particular fetishes. - catholic schoolgirls 2 \_ subset: japanese schoolgirls 3 \_ Wearing Sailor \_ Wearing barely legal 1 petite women 1 Sailor Uniforms 4 \_ wearing a cut-off "spank me daddy" fat chicks 0 petite women 2 Uniforms 3 \_ wearing a cut-off "spank me daddy" t-shirt 1 tall 3 talg 1 illegal 2 petite women 3 B&D 5 spanking 4 little boys 0 -- cogan? tickling 1 fat chicks -1 little girls 4 \_ This almost makes me proud to be a sodan. *sniff* -mlee rootcows 37337 - catholic schoolgirls 3 illegal 2 (Illegal for you or for them?) \_ Well, seeing that this is a fetish list, one MIGHT suppose that we are describing the object of affection/outlet for sexual energy in question, so then it would be -on nweaver 1 pretty fucking clear that "illegal" refers to that 16 year old redheads 1 rootcows 35545 object. If you actually used your brain, then there wouldn't be any confusion, which reminds me, I need to vote for "empty sporous craniums" as we all well know by now that grey matter spoils the \_ Where do you get this? I want some. meat. -mlee fat chicks -2 soda 1 perl 2 mail order russian brides 0 - toothless 1 barely legal 2 illegal 2 petite women 2 petite women 3 rootcows 37337 muchandr 2 \_ recursion in action mail order russian brides 1 big tits 6 anal 5 fully clothed women 0 idaho -1 -on nweaver 1 tentacle 1 fetishes 4 small rodents 2 lila 1 \_ PDP-11s 1 Scheme 1 necrophillia 2 rootcows 31337 crazed psychos 4 \_ Where do you get this? 1 I want some. 3 Ahm 2 fat chicks -3 soda 2 perl 3 lila 666 \_ in leather with a crop 1 and a big fat strap-on pics of lila and kchang 4 the elderly 1 file cabinets 1 rootcows 37337 PDP-10s & LISP 6 BSD driverhacks 1 rootcows 35545 shaving 1 teen shaving 1 raverporn 1 \_ Where do you get this? I want some. sexual torture 3 fat chicks -2 soda 1 perl 2 leather 1 latex 1 reeser 1 \_ That's sick nevman. \_ Incest is best! catholic 1 mormon 1 soft porous craniums 0 soft porous craniums void of grey matter 1 sisters 1 ahm 28 twins 1 Hot babes with no brains 1 lila 1 \_ in a leather corset 1 \_ with leather skirt 1 tickling 2 spinach 3 pics of fatties 1 Hank AKA JSL 2 mail order russian brides 0 amputees 1 oral 0 ASTEROIDS 1,599,990 @ 2020 !!!!!! nuking the motd 666 kane 2 danh & stump fantasies 3 redheads 3 mail order russian brides 1 the Simpsons! 1 wattle 0 fully clothed women 0 idaho -1 |
1999/2/22-24 [Computer/SW/Mail, Computer/SW/Languages/Perl] UID:15463 Activity:nil |
2/22 Trying to decide if we need another T-1. Can anyoned recommend software for monitoring the amount/percentage being used? -crebbs \_ http://www.best.com/~doosh/netrek/netrekFTP.html \_ MRTG rules, and it is free! -ERic http://ee-staff.ethz.ch/~oetiker/webtools/mrtg/mrtg.html |
1999/2/20-21 [Computer/SW/Languages/Perl] UID:15451 Activity:low |
2/19 My supervisor wants to learn Perl but doesn't have any programming background...I don't know any book better than Wall's own but I question if he's capable of using it to do what he needs to do. I also question whether there are any "kid gloves" books would "work" as in general I believe ya gotta pay your dues to get the clues.. Anyone have any advice on this? --jnat \_ yes. learn perl and make him depend on you for all his perl needs. \_ Ho ho ho! But that's the current situation.. I guess the only option is to teach him myself? \_ No, don't be stupid. The above was a perfectly good answer. Why would you want your boss to be able to do the things you're currently doing? Are you getting paid extra to train people at your company? Is that part of your job? Does it enhance your career in any way to teach your boss anything more than how to kiss your ass to get done what he needs done? You're in a great situation, don't fuck it up. \_ when the boss suddenly decides he wants to write code, is just about the #1 major disaster possible. Like you said, he has zero coding experience. So anything he writes is going to be crap. Your best course of action may be 1. teach him some basics 2. say why don't you try to do something now? [give him huge project, and say "I could do this in about a day"] 3. Either he gives up, or makes a total mess ofit. Then say "This takes years of training. Maybe you should leave the programming to me from now on" |
1999/2/4-5 [Computer/SW/Languages/Perl] UID:15356 Activity:moderate |
2/3 Perl Gurus only: Let's say that I need a Perl module, but I don't have root to do "make install". Exactly what files do I need to copy to my local Perl directory, and how do I use the module that resides on my local dir? \_ when you make install, I believe you can go "make install PREFIX=/home/foo/local" or whatever and it'll do the right thing. Then stick "use lib '/home/foo/local/lib/perl5';" at the top of your script. \_ a separate question: When I invoke multipule copies of perl(cgi scripts actually), the machine moves at snail pace. When I have 10 scripts running simultanouesly, the load shoot up to 25!! Anyway to get around this problem...and is linux/freebsd better at handling this type of job? with what type of hardware configuration? \_ It's probably out of RAM and swapping. Does your machine have shared memory pages? \_ I am not sure. The server is a ~175MHz machine(SGI most likely) running IRIX with 256Mb of RAM. \_ ps. top. |
1999/1/26-29 [Computer/SW/Languages/Perl] UID:15301 Activity:moderate |
1/26 Is there any command line utility that returns the width and height dimensions of an image file, specifically .jpg & .gif? \_ file foo.gif --dbushong \_ Seems like it only prints the width and height of .gif files but not .jpg files. Why? -- yuen \_ Well, someone keeps deleting this, but again: perldoc Image::Size. If that's too tricky, ~dbushong/bin/imgsize --dbushong \_ Because someone like you didn't take the time to rewrite it to do so. What's up with everyone expecting everything to be pre-written to do exactly what they need? Do it yourself, sheesh. \_ Because chances are someone has written something to do what you want. Why reinvent the wheel? And why suppose the person has the time or knowledge to accomplish the task? \_ To ask if someone else has done it is differant than asking why they haven't. One is a query, the latter is a whine. I don't suppose they have the time or skill. I object to the whining not the desire to have a feature. \_ Well, since it knows to look into the file content to find out if a file with no ".jpg" extension is a JPEG file, I would think it also knows to look into the JPEG file content to get the width and height. -- yuen \_ Because the author didn't need this function and you didn't add it. \_ Well, someone keeps deleting this, but again: perldoc Image::Size. If that's too tricky, ~dbushong/bin/imgsize --dbushong |
1999/1/26-28 [Computer/SW/Languages/Perl] UID:15297 Activity:high |
1/26 Would like to know if there is a conversion utility for taking a very large bourne shell script and turning into a Perl one. I don't look forward to re-writing 20K+ of scripts somebuddy else wrote. -mtbb \_ While this is theoretically possible, the naive version would generate nasty code, and even the best version couldn't generate good code; the styles differe too greately between sh and perl.. why do you need to rewrite them in perl? --dbushong \_ because the effort of porting them is less than the effort of trying to get sh to do what you want it to do? -tom \_ I would rather deal with sh than with script-produced perl --dbushong \_ Depends on how much it needs to change in the future. Some stuff is a bitch to do in sh. You can script-port to perl and then rewrite it in pieces over time as required and enhance more easily in the long term this way. \_ Becauer PERL r000lez! \_ The reason I need to put this into Perl is because Perl is portable \_ See if you can license one of the [c]sh programs for NT. We have one at work, MKS Toolkit. -meyers to the NT machines we have as well. I was hoping there was a utility to help out, but seeing as the script needs re-writing anyway..... Perl will also allow us, as Tom-Bud pointed out, the ability to code in CGI stuff for better DB-Web application integration in future modules. -mtbb \_ bash for NT exists. \_ Oh just stop. None of the ported shells work as expected under NT. Stop offering half assed unix-centric solutions for NT problems. Just because it exists doesn't mean it works correctly. \_ bourne shell scripting is NOT UNIX-CENTRIC, it is POSIX.1. Microsloth CLAIMS TO SUPPORT POSIX.1 So you don't have to install anything non-microsloth to run the stupid script. Theoretically, just change the path to SH, and run. Don't complain, if you don't at least TRY to run the scripts, as is, under NT. |
1999/1/19-21 [Computer/SW/Languages/Perl] UID:15252 Activity:nil |
1/18 I'm sorry to repost this, but I lost the motd answer two months ago. Here is my question. In regular shell scripts, I can do `nohup prog &"` or simply `prog &`. However, in Perl, it seems that when I exit the parent Perl program, ALL the children exit as well! How do I make it behave like any other shell scripts, without using fork? Thanks. \_ `prog &` doesn't normally make sense -- backquotes mean to capture the output of a program, but the programs you want to run in the background don't usually generate any output. Perhaps you wanted system "prog &"? \_ AH that works! No wonder when I kill my parent process, the children dies (cuz I'm waiting for their output). THANKS MOTD! |
1999/1/15-17 [Computer/SW/Languages/Perl] UID:15236 Activity:nil |
1/14 I'm running Apache on a Linux box and it won't seem to allow me to post to/from a PERL script. I keep getting the error mesg: "The requested method POST is not allowed for the URL..." Is there some thing i can set somewhere to allow this?. Any help is appreciated -crebbs \_ Options ExecCGI \_ this goes where? httpd.conf?? |
1999/1/11 [Computer/SW/Languages/Perl] UID:15207 Activity:high 75%like:15553 |
1/11 Troll on Perl deleted -tom II \_ It wasn't a troll, asshole. WTF is wrong with you people? Don't you have jobs or a life or anything? Stop fucking with other people's motd entries, trolls or not, and piss off. \_ Grab it from mehlhaff's RCS archives & post to http://ucb.org.csua & ucb.cs.undergrads so the assholes can't nuke it |
1999/1/11 [Computer/SW/Languages/Perl] UID:15206 Activity:very high |
1/11 Is there any reason Perl couldn't/shouldn't replace scheme & java as the languages of choice for 61x? Yes, it can be damn ugly, but the iteration/recursion difference is a lot clearer, the CPAN provides many excellent examples of abstraction & component use, and it's a lot easier to get perl to work on home computers (unix, mac, or winblows) than scm/Dr. Scheme. Everything scheme & java can do perl can too. (Well, java does win at threads for now, but that's not taught in the 61-series is it?) \_ does Perl support closures and upward funargs? -nick \_ It has both static & dynamic scoping, and you can close over statically-scoped vars. \_ Perl is kinda messy. It also assumes you have a brain and know something about systems as well. There's lots of niggly little historical things in PERL that a freshy wouldn't get. Scheme, although useless in the RW is much cleaner (as taught in freshy courses) and there's already tons of experience at Cal teaching it the right way. I love PERL, but I don't think it's a good choice for a first language. Java? Which Java? heh. \_ Perl can be learned the wrong way, and is much easier to cheat solutions that do the "task", but in the wrong way. \_ basically, if the 61 series is a place people can get excited about programming and get tools they can use to actually create useful programs themselves, perl is a good choice. If it's a weeder series, where you're trying to knock out people who aren't really interested by making them use a crappy language with no practical purpose and no redeeming features, scheme is a good choice. In a typically Berkeley manner, the department has decided to go for the latter option. -tom \_ um, scheme is not being used with those goals in mind at all. scheme is used b/c that's what the book that bh likes uses, and b/c it's a nice simple elegant language that is easy for first-time programmers to work with. it may not be practical, but it certainly has redeeming features. see response below. \_ Y3AH, D00D!!!1! 1 AGR33 W1TH T0M 100,000,000%%!!!!1!!! P3RL 1Z __S0__ MUCH M0R3 K-RAD THAN SCH3M3!!!1! B3S1D3S, 1F TH3Y ALS0 TAUGHT P33PUL H0W 2 PLAY N3TTR3K AND DR1NK D13T C0K3 1N TH3 61 S3R13Z, P33PUL C0ULD QU1T SCH00L AND MAK3 L0TZ UV M0N3Y BY B3CUM1NG 1NSTANT SYSADM1NZ!!!1!!! \_ gee what an intelligent comment. -tom \_ did that look like it was meant to be an intelligent comment to you? \_ The 61-series is designed so that someone can come in knowing nothing about computers (but hopefully knowing at least "induction" which is the math version of recursion) and as they work their way through the series the levels of abstraction choices of syntax to use. Probably not the best choice for a gradually go away and you end up in assembly. Remember, the goal is not to learn an interesting language, it is to learn *about* computer languages, about how we use computers. In languages like Perl, a lot of other "junk" gets in the way of doing that. Also, the Abelson & Sussman text really is a good text. Chances are if it used Perl, Berkeley would be using Perl. \_ Scheme is pretty much a pure functional language. It's a good environment to learn about how to structure programs, break problems into components, etc. It also has a rigid, well-defined syntax. Perl is powerful, but not only are there 100+ ways to get any task done, there are several choices of syntax to use. \_ and most of them disgusting. Probably not the best choice for a first course in functional programming. \_ "In English Composition 61, we force everyone to write in iambic pentameter, because the rigid, well-defined syntax makes people broaden their vocabulary and appreciate Shakespeare more." What a crock of shit. No amount of time spent working around the klunkiness of a language is more valuable than time spent actually solving problems through programming. The fact that there are lots of ways to get stuff done in Perl is a *good* thing, if what you want to teach is how to get stuff done. You're fooling yourself if you think the 61 series is supposed to do anything but weed out English majors (as English 61, above, would be designed to weed out CS majors). -tom \_ when i took cs61a i found it to be a very good introduction to the concepts of programming (for a person who had never done any before that class except a couple of lines of basic in some lame hs computer tools class), and also friendly and not intimidating. it didn't seem like a weeder course at all. i'm sure the class itself has much more of a weeder feel now, since cs is so overloaded, but i still think that scheme is a nice language within which to teach the basic concepts. if 61a had used perl i probably would have freaked. -lila \_ And since we all know English and CS are the same thing.... \_ this reminds me that I switched from an english major to CS because of 60a (SICP w/ Wilensky).. --karlcz |
1999/1/7-10 [Computer/SW/Languages/Perl] UID:15184 Activity:nil |
1/7 Love perl? Need a FT job with great benefits? Mail marco. |
1998/12/16-17 [Computer/SW/Languages/Perl] UID:15099 Activity:high |
12/15 How would I count the number of occurances of a pattern in Perl? \_ the easy but incorrect way to do it is grep pattern file | wc -l \_ In a single line? In a file? In what? \_ Find pattern. $count++; \_ Yeah, this would work if I'm feeding a for loop line by line. But what if you have say $foo = "aaabbbaaacccaaa" and you want to count the number of times 'aaa' appears? \_ Use the same algorithm. Implement "find pattern" differently. Twink. Try while ($foo =~ m/pat/g) { $count++ } or $count = length($foo =~ m/pat/g); \_ Thanx, but can anyone ask anything on this motd without being branded a twink? I guarantee you there is not one question here that someone won't think is trivial or self-evident or just plain dumb. \_ you then have to decide if "aaaaaa" matches with "aaa" once, twice, or 5 times. \_ troll deleted -tom \_ tr/// it into its identical string/pattern and catch the returned result in a variable. The result will be the number of times the translation (in this case the null translation) was performed. Example from camel book: $cnt = $sky =~ tr/*/*/; # count the stars in $sky -brain |
1998/12/4-6 [Computer/SW/Languages/Perl] UID:15073 Activity:high |
12/4 I'd like to write a simple mail client using Perl5. Should I download the CPAN module for IMAP4 or POP? Which one is better in performance? Which one is easier to program? Thanks. \_ What added features does IMAP4 have over POP3? People brag that you can download only message headers under IMAP and selectively download only certain message bodies but it seems that you can do the same with POP. \_ On the side note, is there a command line mail utility, that is the same for Solaris and Linux, that allows you to read mail content and read mail headers using just command line? \_ mh \_ eww, yuk. I used mh for a whole summer because the place I worked for had nothing else. vi beats pico any day but mh was just nasty. \_ Peasant. mh is awesome. You use /bin/mail? \_ I use a program that's part of ELM, called "readmsg". -brg \_ If you're making this because you're a perl stud and want better handling of mail, you might look at 'mailagent' (perl moral equivalent to procmail). -lim |
1998/12/3-6 [Computer/SW/Languages/Perl] UID:15063 Activity:nil |
12/3 Need perl hacker for a few days to write a preprocessor for an assembler. Contact ali. \_ ali needs to be sodomized |
1998/10/21-25 [Computer/SW/Languages/Perl] UID:14806 Activity:low |
10/21 Anyone know a good perl module (or other reliable method) of interfacing with mail spools? Specs for spools? -jnat \_ you just want to read the spools, or do all the file locking stuff as well? \_ formail and procmail are pretty useful \_ ever considered scanning CPAN under the Mail:: namespace? |
1998/9/29-30 [Computer/SW/Languages/Perl] UID:14699 Activity:kinda low |
9/29 The other day when I was using "dict" it somehow searched a lot of different online dictionaries rather than just Webster, but I could not reproduce it. What is the right command? \_ dict/webster queries a secondary source when EB Webster fails to return a definition. there isn't a way for end-users to specify which source to use at run time right now. but you can go to <DEAD>work.ucsd.edu:5141/cgi-bin/http_webster<DEAD> with any browser in the mean time. -jwang \_ of course, since dict is a simple perl script, if you were an elite perl hacker, you could hack it to do that yourself. \_ Then someone must be changing the script when I ran dict the other day, because it queried about 4 or 5 different sources, with very nice quotations of actual usage and detailed notes on similar words. Hope it can remain that way. \_ the second source (in the URL) is in fact a gateway to about 4 or 5 other databases. again, it's only used when the primary Encylopedia Britannica Webster database fails. -jwang |
1998/9/15-16 [Computer/SW/Languages/Perl] UID:14605 Activity:insanely high |
9/15 Is there any way in Perl to do the same is #include in C? That is, just insert the text of one file into another? \_ if you mean to include or share perl libraries, the "require" keyword will work in most cases. perl5 has more powerful module support with "use". \_ No, I have one big script that parses input, and would like to use it in another to parse and do some other stuff. Basically, I have file1.pl, and would like to do #include "file1.pl" sub_defined_in_file1(); \_ he answered your question, idiot. \_ No he didn't. I've read the docs on require and use, and it isn't working. I'm not trying to include perl libraries. \_ require is what you want. your fu is weak. train harder. \_ require "included.pl" returns: included.pl did not return a true value at test.pl line 2 Since I was specifically looking for something as simple as #include, it appears that require won't do the job. I don't want to go through the hassle of creating a module if I don't have to. A simpler answer to the first question would have been, "No, there is no equivalent of #include in perl. You have to create a module." \_ No you don't have to create a module, just make the last line of the file you require be: "1;" which will evaluate to the true value perl is looking for \_ Thank you! \_ You obviously didn't RTFM. \_ Yes. He did. Indeed your fu is not weak. You lack all traces of fu. \_ My kung fu is the best. -billg \_ Everyone was kung fu fighting -discoman \_ Why yes indeed. Perl needs to run with the -P flag. That can go in Also read the man pages on use and require -- there are some subtle differences (among other things, require does "run -time" inclusion, and use does "compile-time" inclusion. in the shbang line (e.g. "#!/path/to/perl -w -P"). man perlrun for more details. -anirvan \_ Summary of require solution: require "include.pl"; the last expression in include.pl must evaluate to true (non-zero) \_ i.e. make the last line: 1; \_ Read about the AUTOLOAD method in the perlsub manpage. Also read the man pages on use and require -- there are some subtle differences (among other things, require does "run -time" inclusion, and use does "compile-time" inclusion. |
1998/9/7-9 [Computer/SW/Unix, Computer/SW/Languages/Perl] UID:14555 Activity:high |
9/6 Someone should crack root on eecs instructional and administer that damn thing since no one seems to be. \_ In the last month, jenni, alanc, & monish left. While they did hire brg, it will take some time to get back up to speed. \_ so is jon the only competent sysadmin left at berkeley. \_ no, there are many much more competent than jon, they just don't work for eecs inst. \_ to name a few, mike sinatra, brian shiratsuki, rob mcnicholas. --jon \_ brg >> jenni+alanc+monish --brg #1 fan \_ but brg can only work << jenni+alanc+monish --brg #1 realist \_ And I curse the life I'm living, and I curse my poverty, And I wish that I could be, oh I wish that I could be, Oh I wish that I could be root@cory. -- schoen, who has actually written the other verses too \_ Yuk, i became a cs major because i hated poetry. \_ it's amazing how telling that statement is. read a book that's not published by o'reilly sometime. \_ Really, ORA books have quite a lot of poetry in them (they're pretty literate), but, in general, poetry is a Good Thing. - humanities h0zer \_ Perl Poetry doesn't count. \_ I know. Some of the books have actual poetry, in examples or in chapter epigraphs. \_ According to Larry Wall, these programs actually do compile (yes perl compiles) and runs. Incidentally, they do nothing interesting. \_ It seems to me that CS majors in general have the most depth of knowledge, yet least breadth. Not necessarily a bad thing, but not all that great either. \_ It is perhaps one of the tragic aspects of this high-tech economy. Depth of knowlege will get you a cool job. Breadth of knowledge will likely have you flipping burgers. Hard choice to make there... \_ I bought O'Reilly's Posix Poetry. Brought tears to my eyes. -poetry lover \_ I cracked it - what you do want done? - rewt \_ The mailspools of all the cuties (null set?) \_ Mail is _always_ boring. If you're going to ever break root, please don't do it for something stupid like reading some chick's boring email. \_ not to mention it is usually easier to hack the "chick's" account than root - if she is a true chick her passwd should be something simple, try dddelta or such, or there is always the social hack (ask her personal questions - the name of her dog?), or just wait for her to walk away from her logged in session and rhost, cp her whole file structure, fwd her mail, or if you don't want to be caught, xhost yourself and look at her screen :) \_ ali, you sound as if you have experience |
1998/7/30 [Computer/SW/Languages/Perl] UID:14413 Activity:moderate 50%like:14387 |
7/29 perl-5.005_01 (the latest non-beta version) installed, bugs to mconst. \_ Is this a version _without_ the threads compiled in, cause I heard threaded perl might run slower (but I havent installed 5.005 myself yet ) \_ perl5 -V yields: usethreads=undef useperlio=undef d_sfio=undef ^^^^^^^^^^^^^^^^ \_ could you link perl5 back to the stable perl5.00404 please? \_ perl-5.005_01 is an official release (the _01 is a maintenance patch, not a development version); as far as I can tell, it's more stable than 5.004_04 was. I saw someone complaining on wall that LWP didn't work; I've recompiled LWP (along with most of the other modules we had installed) to work with 5.005. If you find anything else that doesn't work with the new perl, please let me know. --mconst \_ ok fine. but remember p54 didn't stablize till patch 04. |
1998/7/29-30 [Computer/SW/Languages/Perl] UID:14407 Activity:low |
7/28 Has anyone used linux in any home automation systems. x10/CP290 boxes and such? --smitty \_ I have a cron job that makes my coffee, adjusts the AC/heat, calls the office to tell them I'm working from home again, and then walks the dog. \_ cron? who needs cron -- I only use perl \_ Larry Wall gave a neat demo of how he uses x10 boxes at his home in conjunction with Linux and Perl just a few months back at SVLUG. He said that the x10 protocol was easy to use if you could get a home automation control box with a serial interface. I didn't pursue it any further, personally I'm more interested in wireless ethernet at home. |
1998/7/27-28 [Computer/SW/Languages/Perl] UID:14402 Activity:high |
7/23 Long bit truncated down to: but this is what i wanted to do: foreach f (*.gif) mv $f `echo $f | sed 's/\(.*\)\.gif/\1th.gif/'` end it seems like it's better done at the command line. I didn't think you can do that in as few bytes (and processes) in perl. \_ If you want to do it once, period, for the rest or eternity, fine, do that. But the perl is: foreach $f (<*.gif>) { $f =~ s/\.gif$//; rename("$f.gif", "${f}th.gif"); } Process count: Shell: 4 Perl: 1 Process count: Shell: 4 per file renamed Perl: 1 Byte count: Shell: 90 Perl: 139 49 more bytes, but runs much, much faster (really, try it on Byte count: Shell: 70 Perl: 75 \_ isn't the carat supposed to be a dollar-sign? -- idiot \_ 68 bytes but uglier: 5 more bytes, but runs much, much faster (really, try it on even 50 files) --dbushong \_ 66 bytes but uglier: foreach (<*.gif>) { s/\.gif$//; rename("$_.gif", "${_}th.gif"); } \_ 62 bytes: \_ 57 bytes: $g=".gif";foreach(<*$g>){s/$g$//;rename($_$g,${_}th$g);} \_ are you sure you can do $_$g ? \_ with the extra added bonus of globbing via <> ick ick but that's a stylistic issue |
1998/7/24-27 [Computer/SW/Languages/Perl, Computer/SW/Unix] UID:14382 Activity:moderate |
7/23 How do you do this in sed, not perl? s/(.*).gif/$1th.gif/; s/(.*).gif/\1th.gif/ \_ sed: 1: "s/(.*).gif/\1th.gif/": \1 not defined in the RE \_ try this instead (ugly, but works): sed 's/.*/&th.gif/;s/.gif//' \_ sed 's/\(.*\)\.gif/\1th.gif/' (sed uses \( and \) to mean "save this") also, don't forget to \ the . so it doesn't mean "any character" --dbushong \_ woo woo, that's what i was looking for. you da man! \_ This being said, perl regexps are significantly nicer than sed, perl -e 'regexp' is nicer than sed 'regexp' And if you're applying it to an entire file in place, you can say perl -pi -e 'regexp', whereas you need to create tempfiles for sed.. --dbushong \_ but this is what i wanted to do: foreach f (*.gif) mv $f `echo $f | sed 's/\(.*\)\.gif/\1th.gif/'` end it seems like it's better done at the command line. I didn't think you can do that in as few bytes (and processes) in perl. \_ You can do it in 1 process, and approximately the same number of bytes, in perl. -tom \_ Yeah? So? sed is for real men. You sound like a limp-wristed, lisping girly-man. You probably use emacs instead of ed, too, I'll bet. \_ ed? You pansy faggot! I use cat, don't make any mistakes and never need to edit a file because I thought ahead and did it right the first time! \_ why are perl regexps "nicer"? \_ In general, they require fewer backslashes, support all the standard operators, and add some new and useful (if tricky) things like non-greedy qfiers. |
1998/7/11 [Computer/SW/Languages/Perl, Computer/SW/Languages/Misc] UID:49814 Activity:nil |
7/10 A quick and dirty spam filter i wrote: http://www.csua/~jefe/.nospam I'm not really sure how well it works and it might even filter out real mail. \_ You expect us to run a binary without source or do you expect that a shell script can be run if an arbitrary user's process can't read the shell script to find out what shell to run on it? -rwx--x--x 1 jefe csua 2490 Jul 11 00:57 /home/j/jefe/.nospam --jon \_ There is no binary involved. It's all perl script as stated at the top #!/usr/bin/perl. Your procmailrc file will automatically invoke it if it has: :0 | $HOME/.nospam |
1998/6/25-27 [Computer/SW/Languages/Perl] UID:14249 Activity:moderate |
6/25 how do you make emacs auto-indent after pressing "ENTER" in perl/cc-mode? What do I need to add in my .emacs file? TIA - clueless emacs user \_ M-X vi-mode; set ai \_ In your .emacs, add: (add-hook 'c-mode-common-hook (function (lambda () (define-key c-mode-map "\C-m" 'newline-and-indent) ) ) ) ... And a similar thing for your perl mode. --sowings \_ I assume it's: (add-hook 'perl-mode-common-hook (function (lambda () (define-key perl-mode-map "\C-m" 'newline-and-indent) ) )) for perl? it didnt work for me. - still clueless \_ It would probably be 'perl-mode-hook, without "common". \_ Use vi. |
1998/6/8 [Computer/SW/Languages/Perl] UID:14186 Activity:nil |
6/8 Anyone knows how Perl does its checksum in unpack? I need to implement unpack("%32C*", "some string") in Java...any ideas? |
1998/5/16-17 [Computer/SW/Unix, Computer/SW/Languages/Perl] UID:14101 Activity:high 50%like:14484 |
5/16 How do I remove repeating lines form a text file so that any line of text only appear once, at most? \_ uniq. If the repeated lines aren't necessarily next to each other, use sort first. \_ But I want to keep the original order (of first appearance). \_ you could always write a C program to do it. Not necessarily the most productive way, but it could be fun. \_ thats why theres perl |
1998/5/16-17 [Computer/SW/Languages/Perl, Academia/Berkeley/CSUA, Computer/SW/Unix] UID:14099 Activity:nil |
5/14 Summer job with a startup in Berkeley: Unix, Java, Perl. /csua/pub/jobs/RodaGroup - schoen |
1998/5/16-17 [Computer/SW/Languages/Perl] UID:14097 Activity:nil |
5/15 Anyone have a pointer to code or library to take an MD5 fingerprint? Preferably something that has been ported to Digital UNIX. \_ the md5 rfc has code \_ There is lots of (inherently "cross-platform") crypto/authentication stuff in Perl; try CPAN. \_ I'd like C code. \_ why not check out the md5 source in /usr/ports ? \_ SSLeay, what else. \_ md5sum from GNU textutils package --brg |
1998/5/11-12 [Computer/SW/Languages/Perl, Academia/Berkeley/Classes] UID:14077 Activity:nil |
5/8 A friend of mine is looking for someone to do some only-slightly-challenging Perl CGI work? there's $150 or so in it for them, negociable. Mail me if interested: -=aubie \_negotiable |
1998/5/5-6 [Computer/SW/OS/Solaris, Computer/SW/Languages/Perl] UID:14050 Activity:nil |
5/4 In Perl, when I execute time() on Solaris and on Soda, the time is very close. However, when I execute time() on my Linux, there's a discrepancy of about 30000 seconds. On all the machines, the time and date sync, but time() does not. Why is this happening, and how do I fix it? THanks. \_ Your machine's time is wrong; it only looks correct because you have your timezone set incorrectly. Type "env TZ=PST8PDT time" to see what time your machine actually thinks it is. \_ env is a gross hack for those who don't use real shells. \_ How do I change it? Instead of PST, mine says WAT? |
1998/4/29 [Computer/SW/Languages/Perl, Academia/Berkeley/CSUA/Troll/Aspolito] UID:14015 Activity:insanely high 50%like:14025 |
4/28 To mock People's Magazine, I am now doing a contest on the top 10 most beautiful people on soda. \_ three words: pee ess bee - tpc \_ Merriam-Webster's CollegiateĀ® Dictionary contains 2 items relevant for "ess". \_ JSL the Angry, Drunken Dwarf \_ This is like judging the most intelligent contestants in the Miss America pageant. ie. pointless. \_ This is Soda-- shouldn't we have the top-ten most beautiful one-line perl scripts or something? \_ $twink++ if $ENV{"USER"} eq "cmlee"; return $twink; \_ aspo \_ Don't put aspo on this list. How will I ever get him back? -dumped gay lover \_ you that bonedaddy-assplaster-gyrosphincter boy? \_ psb \_ christine \_ tom... \_ why the ellipsis? \_ jsl \_ tawei \_ yer mom \_ This list almost made me think we were electing for the 10 most unattractive people. |
1998/4/15 [Computer/SW/Languages/Perl] UID:13963 Activity:very high |
4/15 Let me clarify on the Perl question. I have two commands need to be spawned from a Perl script, $cmd1, $cmd2. $cmd2 depends on $cmd1. However, $cmd1 and $cmd2 are called millions (no, not an exaggeration) of times in a foreach loop now with different arguements each time, so performace suffers. Now the question is, how to run each set of $cmd1 and $cmd2 in parallel while still keeping $cmd1 and $cmd2 to run in serial? I tried system but failed. Each set of $cmd1 and $cmd2 waits for the previous set to finish... \_ run fork, and have each child system $cmd1 then $cmd2, then exit. The parent process just forks a million times, then exits. Now, make sure to run this on a big box, or million perls will bring you to your knees. - seidl \_ Is there an alternative? fork-ing a million times is expensive even on a big box. (I just ran a simple script that forks 10,000 times and it increased the system load by 10-fold, and it also forbids more processes to be spawned). Can we execute each set in parallel w/o fork? Thanks. Or maybe it wasn't pratical to try to run these millions of set of commands in parallel in the first place? \_ depending on the speed needed, spacing out the forkings might be a good idea (just sleep 0.1 secs between each pair or something like that) \_ So thats 100k seconds per million iterations roughly equals 27 hours per run? 3 million = 81 hours. I think not. That 27 hours is only the added delay between runs and does not include actual runtime for the binaries. \_ doh. well again, it depends on the binaries' runtime. 27 hours might be acceptable if it means not killing an overloaded server. Adjust the figure as as appropriate for a faster box \_ Uh, how do you plan on running different commands without forking separate processes? \_ errrr...good point. So fork is the only option when you want to run things in parallel? How does UNIX shell execute two background commands? By forking twice? \_ Yep. Thats how you get a new process. fork. Now, you might be able to avoid the extra perl processes with creative use of system("$cmd1 ; $cmd2"); but a million jobs in parallel is a lot. - seidl \_ Instead, sh was spawned. Is that necessarily faster than spawning perl itself? \_ Fork isn't the only way to run tasks in parallel -- you can thread things too. But unix command-line programs can't be run in threads. \_ you cna also call system("$cmd1;$cmd2 &"); \_ buy a clue. system forks implicitly \_ if forks but it also waits till completetion you dumbass. try the following in perl system("echo foo; sleep 10"); system ("echo bar"); note that it prints foo, then waits for 10 seconds, and then prints bar. -aspolito \_ Ok... can you rewrite the unix binaries so that you're only doing a single system call from perl and the binary does the looping without forking? Are the command line parameters known before or non-deterministic based on user input, the time, or grains of sand on the beach? I agree with the previous person that doing millions of calls to a binary from perl is a bad way to go. Rewrite the C, if possible, to relieve PERL and the system of this forking burden. |
1998/4/13 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Languages/Perl] UID:13946 Activity:nil |
4/11 For a project, I need to convert a .bmp into a 2D array of numbers that represent each color. For example, say I have a 20x20 pixel .bmp with 256 colors. I need a 20x20 array holding values from 0 (white) to 256 (black). Can anyone point me in the right direction? Any help would be greatly appreciated. -jkwan \_ Assuming you want to automate this (do it tons of times non- interactively, I'd suggest: use ImageMagick (ick) to convert them to .xpm, which is acii format roughly how you describe, but with it's colormap specified first. You could then do some perl on that to get what you want --dbushong \_ I suggest you go and get information on bmp file format. There are already c libraries that reads bmp file header and data for on the internet. I have a game book that came with a CD rom with all bmp classes. So, I assume you get it from the internet. |
1998/4/3-4 [Computer/SW/Languages/Perl] UID:13898 Activity:nil |
4/3 The cover of the latest issue of the perl journal is pretty hilarious. \_ This is the sort of super-geek stuff you should definitely never sign. You poor sad lost little boy. Most men would be telling their friends about the cover of the latest Playboy or SI. And then you wonder why people think computer people are losers and anti-social geeks? \_ Ha ha, yes. Quite droll, with a great deal of verve. \_ D00D, WHUT WUZ 0N 1T???/?? 1 WUZ SUPP0Z3D 2 G3T 1T 1N TH3 MA1L, BUT MY M0M TH1NKZ THAT C0MPUT3RZ R A T00L UV SATAN (AND THAT 1"M RU1N1NG MY GRAD3Z BY SP3ND1NG 2 MUCH T1M3 0N TH3M), S0 2 SAV3 MY S0UL, SH3 T00K 1T 0UT UV TH3 MA1LB0X && SHR3DD3D 1T!!!1!!!!1!!!! (AND MY _26OO_ AND _W1R3D_, 2!!1!!!) WHUT D0 1 D0???//??? H3LP!!1!!! |
1998/3/19-20 [Computer/SW/Languages/Perl] UID:13840 Activity:moderate |
3/19 Is there a way to use PERL or some other scripting language to create a windows95/nt shortcut? I want to have something like a .bat file create a bunch of shortcuts then delete itself. It can't be GUI based or interactive beyond an initial double-click. Pointers, URL's, etc, all welcome and appreciated. -stuck \_ http://www.perl.org/CPAN/ports \_ I got it and version 0.03 of the Shortcut module worked perfectly with a recent version of win32perl. Thanks! |
1998/3/18-20 [Computer/SW/OS/FreeBSD, Computer/SW/Languages, Computer/SW/Languages/Perl] UID:13830 Activity:moderate |
3/18 Has anyone (else) encountered a bug where after using lseek with a negative offset read stops working on that fd, even though a valid off_t was returned? In particular, I have a file with two binary unsigned longs at the end, and when I do an lseek(fd, -2*sizeof(unsigned long), SEEK_END); the reads then fail. -mel \_ Use PERL. \_ Did you try seeking to the beginning to the file, then a forward seek to where you want to read as a work-around? \_ The file is full of longs and I had wanted to read the two longs at the end of it. The workaround I found was: end_offset = lseek(fd, 0, SEEK_END); lseek(fd, end_offset-2*sizeof(long), SEEK_SET); which is ugly but it works. Throw in a few error checks on the return codes and it should work for you too. -mel \_ mel you ugly squint, get off the motd \_ And now, the right answer: You are specifying a seek relative to SEEK_END... Such a seek is implicitly in the negative direction, since it's impossible to seek past the end of the file. The minus sign in front of the 2 is unnecessary. So you should be doing: lseek(fd, 2*sizeof(unsigned long), SEEK_END); I tried looking for an example of this in K&R, but in each instance where SEEK_END is used, they demonstrate with an offset of 0, which is not too instructive. WHY HAST THOU FORSAKEN ME, K&R? I TOOK THY WORD AS GOSPEL ONLY TO FIND A HALF-TRUTH LYING IN WAIT TO SNARE THE UNWARY! -mogul (hey, it's 3:15am, fuck off!) \_ Not quite. A seek from SEEK_END is not implcitly negative; just like SEEK_CUR and SEEK_SET, positive offsets go forwards and negative offsets go backwards (see lseek(2)). The problem with your code (and it's not really your fault) is that sizeof returns a size_t, which (on freebsd) is an unsigned int; when you multiply that by -2, you get another unsigned int (K&R 2.0, p. 198); and the unsigned int (0xfffffff8) then gets promoted to a signed long long (0x00000000fffffff8). This is not what you want. The Right Way to fix it would be for freebsd to make size_t an unsigned long long, but that would break a lot of stuff and probably won't happen soon; in the meantime, you can cast the return value of sizeof to a signed int and your code will work. --mconst |
1998/3/18-19 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Languages/Perl] UID:13828 Activity:high |
3/18 looking at mi professors and tas and manager resumes, these people dont know how to c0de shit in perl and c/c++ and shell and java, yet they make/will make more $ than me, what the fuck? \_ I have actually heard a manager refer to programmers, unflinchinly, as "unskilled labor", by which I think he meant disposable/inter- changeable or something. Im not sure \_ It depends on what kind of application you develop. I would not call people developing optimized 3d game engine or financial application "unskilled". \_ No, people who develop financial applications are unskilled. Gamers are pretty cool, though. \_ demand for a raise and see how high you can go \_ Because coding is for kiddies. You can teach any idiot how to code. It really isn't that hard. Look how many idiots are doing it right now. No PhD required. If you wanted to make big bucks you went into the wrong field and now possess the wrong skills. Sorry, but you're pretty confused about the world and your career is already fucked. Time to retrain I guess. \_ It doesn't matter anyway; when bh and his Communist GNU buddies win, you'll all be writing code for free. (Hope you like doing support . . . ) \_ POT STICKER POWER! YEE HAA! Actually I'm glad we have self appointed victims like the FSF/GNU people but I wouldn't want to be one. \_ If it weren't for GNU cc, our lives would REALLY be fun. (you, yes you, could write your projects using ULTRIX cc!) I, for one, am rather thankful to have cross-platform tools that *work* for a change... -brg \_ I did. Thanks. Wasn't much different except the code ran a tiny bit faster. |
1998/3/5-7 [Computer/SW/Languages/Perl] UID:13760 Activity:high |
3/4 Perl gurus: If I can convert from gmtime to scalar time (ie. convert a number like 8892341243 -> 2/3/98 11:00PM, how do I do the reverse? Thanks. \_ use Time::Local; |
1998/2/25-3/25 [Computer/SW/Languages/Perl, Computer/SW/Unix] UID:13734 Activity:very high |
3/25 Any easy ways to calculate median via UNIX utils like bc? \_ use awk \_ use Statistics::Descriptive; \_ descriptive.pm not found. \_ get it from CPAN \_ whatever happened to BLSS? That had all sorts of cool statistics applications. \_ can we scam a license off of the STAT dept? Think they'd want porting help, or a BSD platform to build on? \_ Mail to blss@stat. Can't hurt to ask. \_ #!/usr/local/bin/perl @sorted = sort {$a <=> $b} @ARGV; print $sorted[$#sorted/2], "\n"; or, if you prefer, perl -e '@sorted = sort {$a <=> $b} @ARGV;' \ -e 'print $sorted[$#sorted/2], "\n";' 6 23 9 1 0 23.3 4 -emarkp \_ Just curious: if I've got "1 2 3 4" is "2" the correct response, according to any math texts? -math ignorant \_ Yes, "2" is the correct answer, because Soda is really an Apple ][ Plus running Apple Integer Basic. \_ It's true! Yes, the lottery scheduler is _THAT GOOD_. \_ I think, actually, that it should be the average of 2 and 3 (i.e. 2.5). Oh well, back to the drawing board. -emarkp \_ can we scam a license off of the STAT dept? Think they'd want porting help, or a BSD platform to build on? \_ Mail to blss@stat. Can't hurt to ask. \-the BLSS people seemed pretty amenable to work with us \_ watch your gramar^ when i dealt with them on behalf of the ocf. --psb \_ Mark is pretty cool. If he can do it legally, he will. \_ If there's an even number of items in the array, take the middle two ($#sorted/2 and $#sorted/2 +1), add and div by 2 \_ okay, here we go: perl -e '@sorted = sort {$a <=> $b} @ARGV; \ $half = $#sorted/2; \ print (($#sorted % 2) ? ($sorted[$half]+$sorted[$half+1])/2 : \ $sorted[$half]); print "\n";' 1 2 3 4 \_ My version :-) Truly, a work of art. :) #!/usr/local/bin/perl5 -w @sorted = sort {$a <=> $b} @ARGV; $len = $#sorted +1; if ($len /2 == int($len /2)) { $avg = (@sorted[($len /2)] + @sorted[($len -1) /2]) /2; print $avg . "\n"; } else { print $sorted[$#sorted/2] . "\n"; } \_ use Statistics::Descriptive; $stat = new Statistics::Descriptive::Full; $stat->add_data(@ARGV); printf("the median of [%s] = %s\n", join(',', @ARGV), $stat->median); \_ show off. mine is easier to read. :-) \_Can't locate Statistics/Descriptive.pm in @INC at ./test.pl line 3. BEGIN failed--compilation aborted at ./test.pl line 3. |
1998/2/10-11 [Computer/SW/Languages/Perl] UID:13655 Activity:moderate |
2/10 Do RoverBot and other Spiders usually traverse through your first level of *.cgi? Thanks. /- no. _ Perl IS THE GREATEST LANGUAGE IN THE WORLD! My mom uses it, my dad / uses it, and SO SHOULD YOU OR ELSE YOU ARE NOT HUMAN!!! |
1998/2/10-11 [Computer/SW/Languages/Perl] UID:13650 Activity:high |
2/10 Perl is a great language. However, how do you pass by reference a complex data structure? I am able to pass by reference a simple list when my subroutine refers to $_[$num], but when I have to pass a hash of hash and hash of list, I don't know how to change the referenced value anymore! Please help, thanks. \_ See "perldoc perldsc" for examples and an explanation. \_ list of hash and list of list are easier to demonstrate: %h1 = %h2 = %h3 = (); $loh = (\%h1, \%h2, \%h3); ($h1ref, $h2ref, $h3ref) = @$loh; similarly: @l1 = @l2 = @l3 = (); $lol = (\@l1, \@l2, \@l3); ($l1ref, $l2ref, $l3ref) = @$lol; get it? \_ Yes, that I get, but how about hash of list and hash of hash? perldoc perldsc does not explain any of this. Thanks. \_ IT"S THE SAME WAY: %obj = ('alphabets' => ['a', 'b', 'c'], 'numbers' => [1, 2, 3], 'subs' => [ &get, &put, &set ]); \_ elements of hashes and lists must be scalars. This means that you have to have lists of hash refs and hashes whose values are refs of whatever thingies you want. Boy this is confusing, but I hope I answered your question. \_ oh man, took me a whole week to figure this out. pUrl sucks!!!!!!!!!!!! Now I have to create a totally separate class to handle pass by reference a "slightly" more complicated data structure. \_ Nothing wrong with the lanauge. You just suck because you didn't RTFM *before* you spent a week writing total crap code. "WAAAH! I DIDN'T READ THE MANUAL SO IT SUKZ!!!!!" \_If it takes more than 'awk', just write it in C. -meyers |
1998/2/5-6 [Computer/SW/Languages/Perl, Computer/SW/OS, Computer/SW/Unix] UID:13626 Activity:high |
2/4 Is there a simple UNIX utility that returns the width & height of an image, like jpg or gif? Or can the info be easily extracted? \_ CPAN:Image/Image-Size-2.6.tar.gz \_ its not exactly command-line, but xv can do this pretty easily too. \_ http://www.tardis.ed.ac.uk/~ark/wwwis has perl code to do it, and update your html files too while it's at it \_ Cool! Thx! This is exactly what I needed! \_ The "file" command does it for GIFs... Anyone interested in hacking soda's magic file to have it do the same in it's JPG matching? -mogul |
1998/2/5 [Computer/SW/Languages/Perl] UID:13624 Activity:high |
2/4 Perl manual sucks!Anyway, following the book example 100%, I still can't get select(...,...,...,...) working correctly! Does anyone have an example that works? Thanks. \_ use python; it's got much better socket support. \_ Uh... nevermind. |
1998/2/3 [Computer/SW/Languages/Perl] UID:13616 Activity:very high |
2/3 Perl gurus who think you're all hot: print scalar localtime(2100000000) = year 2036 print scalar localtime(2200000000) = year 1903 So Perl and most UNIX shit are not year 203X compliant? \_ The unix universe ends at 2037 or 2038, I forget which. So, no, unixes in general are not Y38+ compliant. Perl is probably just passing along whatever the system is telling it. \_ make that the 32-bit Unix universe - 64-bit Unixes will last a few billion more years \_ As I said, "unixes in general". \_ some commercial vendors are starting to change their time structs to 64-bit, so this is becoming a reality. \_ Of course, in 2038, we will all be using 4096-bit architectures, so this problem will go away :) \_ This just shows you how stupid designers are, always thinking of what's best for today, but never what's best for tomorrow. These dumb ass engineers are dumb asses, and Clinton trying to get even more incompetent people into high tech is just going to make the matter worse. \_ Please tell me this is brilliant flame bait. Because I was laughing so hard I hurt myself. Then I though it might be serious. Now im not sure. \_ Well it's obvious that you're either a sys admin or a community college graduate thinking that you're a hot shot. \_ dude: you have to lighten up. It's not gonna get any easier :) |
1998/1/30 [Computer/SW/Languages/Perl] UID:49808 Activity:nil |
1/29 If I add AutoLoader in Perl, does it still compile every single subroutine in one file, or only those that are needed during run-time? \_ It's not that simple; you have to prepare your program for use with autoloader... There are online man pages which pwill walk you thru it, or see some of the advanced perl books.... |
1998/1/30-31 [Computer/SW/Languages/Perl] UID:13598 Activity:nil |
1/29 Has anyone ran h2ph on /usr/include and /usr/include/sys? I cant get perl5 to run perl code with socket cuz sys/socket.ph doesnt exists. Of course this could be the problem of the script but since I am helpless, I am just trying to weed out other causes. I'd love to ran h2ph myself, but I dont have write permission. Thanks for the help. - perl clueless \_ use IO::Socket; $sock = new IO::Socket::INET(PeerAddr => $host, PeerPort => $port, Proto => 'tcp'); \_ Thanks. \_ You are welcome. -- cm1ee |
1998/1/23 [Computer/SW/Languages/Perl] UID:13552 Activity:kinda low |
1/21 What is a good random seed function using time and $$ in Perl? \_ One use might be to create filenames for temporary files. --dim \_ a silly first try might be my $filename = $$. time; \_ No you stupid! I want to use srand() with a good seed. SHEESH. \_ As of perl 5.004, you don't have to call srand at all; see "perldoc -f srand" for details. If you want a better random number generator, look at Math::TrulyRandom or /dev/random. \_ hahahah. maybe you should rtfm, state your problem more clearly, and see Math::TrulyRandom on CPAN, Einstein. \_ srand(time % $$); \_ (time % $$) does not generate good random numbers. |
1998/1/6 [Computer/SW/Languages/Perl] UID:49807 Activity:nil |
1/6 If anyone with any Perl 5.004 fu can explain the following behavior coherently, I'd be enlightened. The file is located in ~god/Pub/perl.bugs \_ 1. The first evaluates the backquote expression in list context and stores the first element of the result in $result1. The second evaluates the backquote expression in scalar context and stores the entire result, as a string, in $result2. It has nothing to do with your use of "my"; you can (and should) rewrite the second as my $result2 = `cp --help 2>&1`; See "perldoc perlsub" for more information. 2. Both of your examples work fine for me. Could you elaborate on what goes wrong when you try them? 3. You can't declare $_ with my. This is a special case in perl which may change sometime; it's mentioned in "perldoc perlsub". For now, use local instead of my for $_. |
1998/1/6 [Computer/SW/Languages/Perl] UID:49806 Activity:nil |
1/6 If anyone with any Perl 5.004 fu can explain the following behavior coherently, I'd be enlightened 1) why are the following two different: my($result1) = `cp --help 2>&1`; #problem! scoping? $result2 = `cp --help 2>&1`; #right behavior 2) why are the following two different: subs HEY {}; my($sub1) = 'HEY'; #problem! global scoping problem? $sub2 = 'HEY'; #no problem &$sub1; &$sub2; 3) by inserting my($_), I get an error that is far remote from what Perl really claims to have. Another scoping problem? |
1997/12/3 [Computer/SW/Languages/Perl] UID:32171 Activity:nil |
12/2 Does Perl's dbm package let you synchronize correctly, when different threads access the same dbm file at the same time? |
1997/1/6 [Computer/SW/Languages/Perl, Computer/SW/Unix] UID:32028 Activity:nil |
1/5 /dev/dsk/zd2s2 708588 641735 260 100% /home/perl /dev/dsk/zd4s2 624388 561899 3796 99% /home/grep /dev/dsk/zd6s2 682344 613869 4299 99% /home/uniq --> CLEAN UP now already ... |
1996/11/4 [Computer/SW/Languages/Perl] UID:31984 Activity:nil |
11/4 Hi -- my perl scripts don't work anymore; what gives? :) :) :) :) :) :) :) :) :) :) :) :) :) :) :) \_ RTFmotd.official \_ Welcome to 1996. |
1996/11/4-5 [Computer/SW/Languages/Perl] UID:31982 Activity:nil 82%like:31956 |
11/1 /usr/local/bin/perl now points to perl 5.003. If you haven't yet, now would be a good time to make your scripts perl5-compatible or change the first line to "#!/usr/local/bin/perl4" |
1996/10/28-11/1 [Computer/SW/Languages/Perl] UID:31956 Activity:moderate 82%like:31982 |
10/20 /usr/local/bin/perl currently points to perl 4.036. Sometime on or shortly after 11/1/1996 it will point to perl 5.003. You have until then to make your scripts perl5-compatible or change the first line to "#!/usr/local/bin/perl4" |
1996/10/17-19 [Computer/SW/Languages/Perl] UID:31939 Activity:high |
10/17 Tk400.200 installed. This is a perl5 extension for utilizing TK widgets in perl5 scripts. Sample script is shown below. -- cmlee #!/usr/local/bin/perl5 use Tk; $main = new MainWindow(); $label = $main->Label(-text => "Hello Sodalites!"); $label->pack(); MainLoop(); \_ What I want to know is when we are going to stop calling perl5 perl5, and just call it perl :) :) \_ When you can do it without breaking everyone's old perl 4 scripts. \_ /usr/bin/perl -> perl4, /usr/local/bin/perl -> perl5 is how many sites have it set up. Look into it. \_ Yes sir! Looked into sir! Found that most perl-using soda users have scripts that say "#!/usr/local/bin/perl" expecting perl4 to be there and think you're an asshole sir! Any other orders sir? \_ Make perl4 point to perl, put an announcement in the motd warning people, give people a couple weeks to change their scripts, and then make the switch. -alanc- |
1996/10/6 [Computer/SW/Languages/Perl] UID:31914 Activity:nil |
10/6 I love /usr/local/bin/perl5! -- cmlee |
1996/6/5 [Computer/SW/OS/Linux, Computer/SW/Languages/Perl] UID:31841 Activity:nil |
6/5 People who missed out on last year's RMS vs. TCL/Perl Flamewar Extravaganza should hurry over to gnu.misc.discuss for this year's barnburner - FSF vs. the Linux community over GNU Emacs 19.31's renaming of the OS to "LiGNUx" in a shameless attempt to take credit for Linux's success. Nostalgia buffs should watch for the little old lady from the early 80's Burger King commercials doing a cameo spot asking "Where's the HURD?" |
1994/5/24 [Computer/SW/Languages/Perl] UID:31611 Activity:nil |
5/23 Hyper marked-up perl man page is accessible through ~cmlee/public/htperlman. -- cmlee |
12/25 |