Hi guys, i have a sample of code in here. can someone please explain to me what does this line below does... (($this_mail) = ($this_in =~ /(.*)/gio)); you may refer to the complete source code i have attached below Thanks in advanced...It's really urgent...can someone please help me!!!!
#!/usr/bin/perl # create compare output file for CoIn use Net::LDAP; use Net::LDAP::Util qw(ldap_error_name ldap_error_text); use Encode; $DEBUG = 2; $BASEDIR = "/log/sad/info/net/"; $INFILE = "$BASEDIR/test-contacts.dat"; $INFILE = "$BASEDIR/test.dat"; $NOW = `date +%Y%m%d`; chop ($NOW); $LOGFILE = "$BASEDIR/DP-contacts-$NOW.txt"; $ldapopts_host = "edsldap.dhl.com:389"; $ldapopts_root = "ou=users,o=dhl.com"; &Main; sub Main { $conn_in = Net::LDAP->new($ldapopts_host); die("server failed $ldapopts_host") unless $conn_in; $mesg = $conn_in->bind(dn => $ldapopts_bind,password => $ldapopts_ps +wd); &Debug( 1, "Connected to destination : $ldapopts_host\t$NOW" ); open( IN, "$INFILE" ); while( $this_in = <IN> ) { (($this_mail) = ($this_in =~ /(.*)/gio)); $this_user = $conn_in->search(base => $ldapopts_root, scope => "su +b", filter => "(|(mail=$this_mail)(mailAlternateAddress=$this_mail))" +, attr s => ['uid','mail','mailalternateaddress','cn','ou']); &Debug( 3, "Search:(|(mail=$this_mail)(mailAlternateAddress=$this_ +mail))"); if ($this_user->entries) { foreach $my_entry ($this_user->entries) { $entry_uid = $my_entry->get_value('uid'); $entry_mail = $my_entry->get_value('mail'); @all_alts = $my_entry->get_value('mailalternateaddress'); $my_alt_all = ""; foreach $entry_alt (@all_alts) { $my_alt_all .= $entry_alt; $my_alt_all .= ","; } chop($my_alt_all); $entry_cn = $my_entry->get_value('cn'); $entry_ou = $my_entry->get_value('ou'); &Debug( 1, "$entry_ou|$entry_uid|$entry_mail|$my_alt_all|$entr +y_cn"); } } else { &Debug( 2, "NOT FOUND: $this_mail"); } } $conn_in->unbind if $conn_in; close(IN); } #***************************** # Handle DEBUG #***************************** sub Debug { local( $level, $message ) = @_; if( $DEBUG >= $level ) { if( open( DB, ">> $LOGFILE" ) ) { print DB "\t" x ( $level - 1 ), $message, "\n"; print "\t" x ( $level - 1 ), $message, "\n"; close( DB ); }; }; };

In reply to Can someone help me to explain the code below by anakin30

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.