Hi all,

Someone knows an way to do this more easy?

_BEGIN_
#!/usr/bin/perl
use warnings;
use strict;
my $job = 15;
my $job_name = 'd00000';
print "JOBNAME $job_name LENGTH: ".length($job_name)."\n";
print "JOB...: $job      LENGTH: ".length($job)."\n";
print substr($job_name,-length($job_name),-length($job)).$job."-001\n";
_END_

_RESULT_
JOBNAME d00000 LENGTH: 6
JOB...: 1      LENGTH: 1
d00001-001
1JOBNAME d00000 LENGTH: 6
JOB...: 10      LENGTH: 2
d00010-001
1JOBNAME d00000 LENGTH: 6
JOB...: 100      LENGTH: 3
d00100-001
1JOBNAME d00000 LENGTH: 6
JOB...: 1000      LENGTH: 4
d01000-001
1JOBNAME d00000 LENGTH: 6
JOB...: 10000      LENGTH: 5
d10000-001
_RESULT_

thank's


                
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to