|
|
|
|
|
|
|
![]() |
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
![]() |
#1 |
What do you mean, my birth certificate expired?
|
Yeah I need to learn pearl. Thats true
Thanks |
![]() |
![]() |
![]() |
#2 |
If something's hard to do, then it's not worth doing
Join Date: Sep 2008
Location: Berlin, Germany
Posts: 247
|
I did 14 years ago, it helps. When I mentioned the 'making copies' bit, I've got a perl script (rather, a web application right now), that will let me upload the template, the content, asks me to type in the relevant bits of text, automatically puts banners and text links in the proper places, generates thumbnails off the content I uploaded, writes the whole bunch to disk in the proper spot, and makes 3 copies of every site. Also automatically picks the recips to put on it based on what category I said it should be in, and so on. Be careful though, writing good perl is hard ![]() ![]() |
![]() |
![]() |
![]() |
#3 |
Banned
Join Date: Oct 2003
Location: About to be evicted!!!!
Posts: 4,082
|
I disagree, Took me a few hours to learn the basics and write my first useful bit of code. I could not guess how long it took to learn more throughly because from then on I learnt more as I needed it. Although in the early days some of the jobs were hard to write, and I did occasionally suffer from the "spend five hours writing code that will save you two hours work" syndrome, that was simply because I was still learning. Once it is learnt (and learning it is not hard) writing good Perl is relatively easy.
|
![]() |
![]() |
![]() |
#4 | |
If something's hard to do, then it's not worth doing
Join Date: Sep 2008
Location: Berlin, Germany
Posts: 247
|
Quote:
Practical example being, suppose I have an array full of, say, usernames, and I want to de-dupe them. There's at least 2 ways to do it: Code:
# usernames my @usernames = ('a'..'z','a'..'z'); # a thru z, twice # method 1 sub method_one { my %usernames = (map { $_ => 1 } @usernames); print sort keys %usernames; } # method 2 sub method_two { my %usernames = (); $usernames{$_}++ for(@usernames); print sort keys %usernames } Code:
Rate Method #1 Method #2 Method #1 16181/s -- -41% Method #2 27624/s 71% -- Another fun one; say you have to http escape a string by turning the string into it's own hex interpretation, the one I see most (I've asked this question to applicants at job interviews) is this: Code:
my $string = 'http://someurl/'; printf "%02X", $_ for(split //, $string); Code:
my $string = 'http://someurl/'; printf '%02X' x length($string), map { ord $_ } (split //, $string); Code:
one 53763/s -- -16% two 64103/s 19% -- ![]() Now, for fun, let's both solve this problem: Write a perl script that outputs the numbers from 1 to 100, 10 per line, zero-padded. Example output: Code:
001 002 003 004 005 006 007 008 009 010 011 012 013 014 015 016 017 018 019 020 . . . . ![]() ![]() |
|
![]() |
![]() |
![]() |
#5 |
A boy without mischief is like a bowling ball without a liquid center
Join Date: Feb 2006
Location: clevel.......don't make me say it!
Posts: 436
|
Hi Mike-mijen.Heres a few tips that might make the free site building go a bit faster.I don't know what or how much you know so this might be coca-dodo basic stuff to you but maybe it will speed up a few newbs.
First off, figure out what categories your going to be building for,then build a template with for each one containing your recips.This way you'll never have to hunt down recips every time you build a new site. When you grab content from your sponsor,don't spend all day looking for that 'perfect set' with the hot girl you like.Unless it's real lousy content,just download like 4 or 5 sets and start resizing/re cutting them. Have your keywords and the name of your site chosen before building your site. Make your site nice,attractive and to your liking but DON'T turn it into an all day art project! When I first started it took me forever to churn out a single free site due to my OCD. I would spend the whole afternoon reshaping and rearranging my site and never get anything done.I learned that it's best just to get your site out there on the lists even if your not totally satisfied with it.Besides,surfers aren't sitting at their PC with their pants around their ankles because they like my artwork. When your building a site,just don't make one and call it a day.Build like 4 or 5 sites in a row or even more if you can.Try to set it up where your submitting a site you built a few weeks ago like ![]() Finely,just like anything else,it comes down to repetition.At first your going to be a bit slow,trying to come up with good sales text,layout design ect. but once you build about 5 or 10 sites you'll start to find your own style and see what works and what doesn't.
__________________
![]() |
![]() |
![]() |
![]() |
#6 |
What do you mean, my birth certificate expired?
|
Yeah I feel thats the biggest thing is being organized and not repeating the same steps over and over. Thanks man
peace Mike|acid |
![]() |
![]() |
![]() |
#7 | |
Banned
Join Date: Oct 2003
Location: About to be evicted!!!!
Posts: 4,082
|
Quote:
There is (nearly) always more than one way to do it. Pick the quickest, easiest way. No one will see your code but you, so there is no need to make it dance a jig and whistle the national anthem backwards while counting hits and filing them under referrers. Stick to that rule, and writing Perl IS easy! |
|
![]() |
![]() |
![]() |
|
|