|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
What about Attachments!
I am running around the net like a Carl Lewis, trying to find an easy perl sciprt to allow a file to be emailed. How do you do THAT!
K |
|
#2
|
|||
|
|||
|
Re: What about Attachments!
http://www.stonehenge.com/merlyn/WebTechniques/col46.html
maybe? |
|
#3
|
|||
|
|||
|
Counter
Opening a file is a high overhead operation (in processing time.) Much more efficient to open in read write mode:
<CODE> open(FH,"+<$FileName); $Counter = <FH>; chomp($Counter); $Counter++; seek(FH,0,0); truncate(FH,0); print FH "$Count\n"; close (FH); </CODE> Also, on an active site, you want lock the file or else there is a chance someone else could accidently reset the counter to zero. |
|
#4
|
|||
|
|||
|
or die()
It is always good practice to add a die() statment when opening a file.
An example: <!-- Code --> <p><pre><font color=#008000><xmp> open(IN,$file) or die "Cannot open $file: $!"; </xmp></font></pre><p> <!-- Code --> $! contains the reason why the file wasn't opened. |
|
#5
|
|||
|
|||
|
Re: What about Attachments!
Thanks
I'll look into it |
|
#6
|
|||
|
|||
|
How?
Hello.
I am really new to PERL and want to know where to put all of the code. What I mean is where do I paste the CGI bit and the HTML bit etc... Also after I have cut & pasted the code into my HTML doc, do I have to type any more code or variables into it? Thanks for your help. Clueless. |
|
#7
|
|||
|
|||
|
How?
Hello.
I am really new to PERL and want to know where to put all of the code. What I mean is where do I paste the CGI bit and the HTML bit etc... (in what order). Also after I have cut & pasted the code into my HTML doc, do I have to type any more code or variables into it? Thanks for your help. Clueless. |
|
#8
|
|||
|
|||
|
Re: or die()
Its happening man.
|
|
#9
|
|||
|
|||
|
Garbage Characters
I was able to get this program up and running w/o any problems, but any punctuation left in the comments field is converted into ASCII. Any way around this?
|
|
#10
|
|||
|
|||
|
Re: Counter
This has been a very enjoyable series. I haven't written this much code in years!
How is locking done? That indeed is important. I had to abandon my old counter because it would reset often -- that was why. |
|
#11
|
|||
|
|||
|
Re: Counter
<CODE>
open(FILE,"+<$FileName"); flock(FILE,2); open read update and write back flock(FILE,8) </CODE> one caveat, only works on Unix systems. Urb |
|
#12
|
|||
|
|||
|
Field checking
How do you set it up so it checks to make sure all the fields were entered and have valid information?
|
|
#13
|
|||
|
|||
|
|
|
#14
|
|||
|
|||
|
Confused!
hey!
Well the tutorial was good and i must say very informative. I have C/C++ knoledge and I am working a s an intern for a firm. IT needed me to read Perl tutorial which i did and it wwas very informative. The only thing which is baffling me or i am still confused is about what is CGI script and whats the use of it with webpages where should we have these things. I mean all was going well till this CGI script and all. I don't get whole of it. Thankx Jawad. |
|
#15
|
|||
|
|||
|
|
![]() |
| Viewing: Dev Shed Forums > Other > Development Articles > Perl 101 (part 8) - Putting It To The Test |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|