Link to home
Start Free TrialLog in
Avatar of 3XLcom
3XLcom

asked on

perl send variable

i have a code as given below which works on every minute .
for this line :
my $datadir     = '/var/flows/router1/2013/2013-12/2013-12-18';
bold part is date. and i want to generate this address in the script how should i do it ?

#!/usr/bin/perl

use strict;
use DBI;

# TODO: Change to fit your environment
my $datadir     = '/var/flows/router1/2013/2013-12/2013-12-18';
my $sqlhost     = 'localhost';
my $sqluser     = 'root';
my $sqlpass     = 'gbc1282';
my $sqldbname   = 'ip';
my $sqltable    = 'mytable';
my $coldatetime = 'timestampfromfile';

Open in new window

Avatar of ozo
ozo
Flag of United States of America image

my $datadir     = '/var/flows/router1/2013/2013-12/2013-12-18';
print +(split'(/)',$datadir)[-5..-1];
Avatar of 3XLcom
3XLcom

ASKER

i think you mis understood me

my $datadir     = '/var/flows/router1/'. '2013/2013-12/2013-12-18';


bold part will written by perl
ASKER CERTIFIED SOLUTION
Avatar of ozo
ozo
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of 3XLcom

ASKER

that is it thanks
please check out my other questions