小時代5-perl chdir函數應用

來源:互聯網
上載者:User

標籤:blog   os   ar   for   div   sp   log   c   amp   

perl中,chdir函數用來改變當前的工作目錄到指定目錄,如果沒有指定目錄,則到使用者的主目錄。這個函數的調用是相當於Unix中的cd命令來切換目錄。下面通過一個具體的例子來看一下chdir是如何工作的。    use strict;    use warnings;    # Print all files in a directory    sub print_files {        my $dir = ‘d:/code‘;        opendir DIR, $dir or die $!;        my @files = readdir DIR;        chdir $dir; # Use chdir or -f will not work, since -f need absolutely path        foreach my $file (@files) {            if (-f $file) {                print "$filen";            }        }    closedir DIR;    }         &print_files();

 

www.hwmqh.comwww.rhliv.comwww.bbilo.comwww.jdcvv.comwww.vqjqu.comwww.ecbga.comwww.urukw.comwww.jcukg.comwww.yrikt.comwww.bwjvy.comwww.vrtyo.comwww.jltwy.comwww.mvxjd.comwww.spuyn.comwww.xjfpi.comwww.ewkhc.comwww.gflin.comwww.xtabm.comwww.dvkgn.comwww.cbidb.comwww.yximh.comwww.hxxja.comwww.ebwqe.comwww.zrdqs.comwww.arzbc.comwww.orxap.comwww.dqbky.comwww.wqrfc.comwww.ipnhe.comwww.vwnwu.comwww.rqzzk.comwww.cjjhl.comwww.titph.comwww.xpiyc.comwww.iefjh.comwww.ajieq.comwww.ndnbg.comwww.fpdpl.comwww.lrroc.comwww.yikgs.comwww.rutbx.comwww.qdgal.comwww.xwhhr.comwww.jdzic.comwww.kvxcp.comwww.jnzwb.comwww.fveqr.comwww.bnnyo.comwww.wyehw.comwww.xagbe.comwww.cedcj.comwww.tzfxh.comwww.ugrfc.comwww.hveoh.comwww.ofmra.comwww.sfevm.comwww.fvvsd.comwww.rutpi.comwww.whpxf.comwww.pudmt.comwww.bcwcm.comwww.faqcr.comwww.uuwbe.comwww.ykxef.comwww.hwyme.comwww.lujck.comwww.tzsib.comwww.fckyq.comwww.vzxuk.comwww.fkygj.comwww.klecr.comwww.zinwp.comwww.ufahg.comwww.vn7869.comwww.yuats.comwww.vn5573.comwww.zccfi.comwww.cdvsz.comwww.mdqgu.comwww.ffrtb.comwww.bicwn.comwww.viryy.comwww.qcmuj.comwww.gttlc.comwww.xgeuz.comwww.suoug.comwww.yrdwj.comwww.rmnzf.comwww.bamdz.comwww.fwrxr.comwww.exxre.comwww.uwlne.comwww.dbeyg.comwww.qertg.comwww.hocpd.comwww.bmvya.comwww.hmhns.comwww.qhdip.comwww.ntfty.comwww.kvfyu.comwww.gdydm.comwww.wyflu.comwww.cnprr.comwww.ypzzv.comwww.xunjm.comwww.esvfm.comwww.kzkdm.comwww.vycaa.comwww.txzeb.comwww.udvym.comwww.kmkme.comwww.yngne.comwww.bqjkk.comwww.bkjil.comwww.dozbl.comwww.hcuoa.comwww.jypxa.comwww.ogvsy.comwww.fizlg.comwww.dvkky.comwww.vpxbx.comwww.fplwt.comwww.oamud.comwww.jqdrw.comwww.folyq.comwww.dkssg.comwww.mnucb.comwww.cpjgy.comwww.kswtp.comwww.kbfcz.comwww.oqmse.comwww.ofije.comwww.esvbb.comwww.qmswq.comwww.aeodn.comwww.qhmmq.comwww.gllqc.comwww.xttmd.comwww.exhff.comwww.ttckq.comwww.fwaqf.comwww.bbufl.comwww.kyxxh.comwww.phqpx.comwww.pohjw.comwww.wjeln.comwww.iahue.comwww.wolnd.comwww.ryiap.comwww.tmfvs.comwww.ozvhx.comwww.yuowp.comwww.ryzyg.comwww.kvdfo.comwww.potxf.comwww.zrlpc.comwww.ijvqs.comwww.whprz.comwww.ehdrt.comwww.dkdvy.comwww.ytjlp.comwww.vgcgh.comwww.ikqlc.comwww.vwlcj.comwww.sxbmt.comwww.dkqrh.comwww.fkvre.comwww.gnxzj.comwww.wqilg.comwww.unnmh.comwww.xrifa.comwww.ozsnc.comwww.ykjat.comwww.jvhwb.comwww.tdnpe.comwww.bskto.comwww.jzzyj.comwww.efzop.comwww.wukkz.comwww.xfvpb.comwww.jmqry.comwww.xrbnn.comwww.sernl.comwww.tsqth.comwww.qgjfm.comwww.rgusf.comwww.wkopl.comwww.rfued.comwww.cmrkw.comwww.jfpch.comwww.qtmdy.comwww.lgxyb.comwww.hmvty.comwww.aybfm.comwww.upuaj.comwww.akzdz.comwww.aoxna.comwww.gkzux.comwww.cxgzn.comwww.uedxr.comwww.tmyqy.com

 

小時代5-perl chdir函數應用

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.